diff --git a/README.md b/README.md index 60c79f48..5e992fd0 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ Vouch Proxy supports many OAuth and OIDC login providers and can enforce authent - [Okta](https://developer.okta.com/blog/2018/08/28/nginx-auth-request) - [ADFS](https://github.com/vouch/vouch-proxy/pull/68) - [Azure AD](https://github.com/vouch/vouch-proxy/issues/290) +- [Alibaba / Aliyun iDaas](https://github.com/vouch/vouch-proxy/issues/344) - [AWS Cognito](https://github.com/vouch/vouch-proxy/issues/105) - [Gitea](https://github.com/vouch/vouch-proxy/blob/master/config/config.yml_example_gitea) - Keycloak diff --git a/handlers/handlers.go b/handlers/handlers.go index 484ec5bc..4427738f 100644 --- a/handlers/handlers.go +++ b/handlers/handlers.go @@ -11,16 +11,16 @@ OR CONDITIONS OF ANY KIND, either express or implied. package handlers import ( - "github.com/vouch/vouch-proxy/pkg/providers/alibaba" - "golang.org/x/oauth2" "net/http" "github.com/gorilla/sessions" "go.uber.org/zap" + "golang.org/x/oauth2" "github.com/vouch/vouch-proxy/pkg/cfg" "github.com/vouch/vouch-proxy/pkg/cookie" "github.com/vouch/vouch-proxy/pkg/providers/adfs" + "github.com/vouch/vouch-proxy/pkg/providers/alibaba" "github.com/vouch/vouch-proxy/pkg/providers/azure" "github.com/vouch/vouch-proxy/pkg/providers/common" "github.com/vouch/vouch-proxy/pkg/providers/github" diff --git a/pkg/cfg/oauth.go b/pkg/cfg/oauth.go index 7278d5c2..210f7f80 100644 --- a/pkg/cfg/oauth.go +++ b/pkg/cfg/oauth.go @@ -42,7 +42,7 @@ var ( HomeAssistant: "homeassistant", OpenStax: "openstax", Nextcloud: "nextcloud", - Alibaba: "alibaba", + Alibaba: "alibaba", } ) diff --git a/pkg/providers/alibaba/alibaba.go b/pkg/providers/alibaba/alibaba.go index 4ec5a809..e9577246 100644 --- a/pkg/providers/alibaba/alibaba.go +++ b/pkg/providers/alibaba/alibaba.go @@ -12,10 +12,11 @@ package alibaba import ( "encoding/json" - "golang.org/x/oauth2" "io/ioutil" "net/http" + "golang.org/x/oauth2" + "github.com/vouch/vouch-proxy/pkg/cfg" "github.com/vouch/vouch-proxy/pkg/providers/common" "github.com/vouch/vouch-proxy/pkg/structs" diff --git a/pkg/structs/structs.go b/pkg/structs/structs.go index 1dcbf2f3..6f4f632f 100644 --- a/pkg/structs/structs.go +++ b/pkg/structs/structs.go @@ -184,10 +184,10 @@ func (u *NextcloudUser) PrepareUserData() { } } -//Alibaba Aliyun +// AlibabaUser Aliyun type AlibabaUser struct { User - Data AliData `json:"data"` + Data AliData `json:"data"` // jwt.StandardClaims } @@ -200,14 +200,16 @@ func (u *AlibabaUser) PrepareUserData() { u.ID = id } +// AliData `data` subobject of Alibaba User response +// https://github.com/vouch/vouch-proxy/issues/344 type AliData struct { - Sub string `json:"sub"` + Sub string `json:"sub"` Username string `json:"username"` Nickname string `json:"nickname"` - Email string `json:"email"` - ID string `json:"ou_id"` - Phone string `json:"phone_number"` - OuName string `json:"ou_name"` + Email string `json:"email"` + ID string `json:"ou_id"` + Phone string `json:"phone_number"` + OuName string `json:"ou_name"` } // Team has members and provides acess to sites