mirror of
https://github.com/mattermost/mattermost.git
synced 2026-10-29 18:53:04 +08:00
initial server implementation for using google as a single-sign-on oauth service
This commit is contained in:
@@ -1314,9 +1314,15 @@ func GetAuthorizationCode(c *Context, w http.ResponseWriter, r *http.Request, te
|
||||
|
||||
clientId := utils.Cfg.SSOSettings[service].Id
|
||||
endpoint := utils.Cfg.SSOSettings[service].AuthEndpoint
|
||||
scope := utils.Cfg.SSOSettings[service].Scope
|
||||
state := model.HashPassword(clientId)
|
||||
|
||||
authUrl := endpoint + "?response_type=code&client_id=" + clientId + "&redirect_uri=" + url.QueryEscape(redirectUri+"?team="+teamName) + "&state=" + url.QueryEscape(state)
|
||||
|
||||
if len(scope) > 0 {
|
||||
authUrl += "&scope=" + utils.UrlEncode(scope)
|
||||
}
|
||||
|
||||
http.Redirect(w, r, authUrl, http.StatusFound)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user