oidc.go 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // Copyright 2019 Yunion
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package identity
  15. // OpenID Connect Config Options
  16. type SOIDCIdpConfigOptions struct {
  17. ClientId string `json:"client_id"`
  18. ClientSecret string `json:"client_secret"`
  19. Scopes []string `json:"scopes"`
  20. Endpoint string `json:"endpoint"`
  21. AuthUrl string `json:"auth_url"`
  22. TokenUrl string `json:"token_url"`
  23. UserinfoUrl string `json:"userinfo_url"`
  24. TimeoutSecs int `json:"timeout_secs"`
  25. SIdpAttributeOptions
  26. }
  27. type SOIDCDexConfigOptions struct {
  28. ClientId string `json:"client_id"`
  29. ClientSecret string `json:"client_secret"`
  30. Endpoint string `json:"endpoint"`
  31. SIdpAttributeOptions
  32. }
  33. type SOIDCGithubConfigOptions struct {
  34. ClientId string `json:"client_id"`
  35. ClientSecret string `json:"client_secret"`
  36. SIdpAttributeOptions
  37. }
  38. type SOIDCGoogleConfigOptions struct {
  39. ClientId string `json:"client_id"`
  40. ClientSecret string `json:"client_secret"`
  41. SIdpAttributeOptions
  42. }
  43. const (
  44. AZURE_CLOUD_ENV_CHINA = "china"
  45. AZURE_CLOUD_ENV_GLOBAL = "global"
  46. )
  47. type SOIDCAzureConfigOptions struct {
  48. ClientId string `json:"client_id"`
  49. ClientSecret string `json:"client_secret"`
  50. TenantId string `json:"tenant_id"`
  51. CloudEnv string `json:"cloud_env"`
  52. SIdpAttributeOptions
  53. }