1
0
Fork 0
mirror of https://github.com/Luzifer/nginx-sso.git synced 2024-12-20 04:41:17 +00:00

Fix: Google not returning refresh tokens

which then causes logins with duration of more than 60m to time out and
not be able to refresh as of the missing refresh token. The "offline"
access type should ensure the token always contains a refresh token and
the user can be active for longer than 60m.

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2019-05-13 21:23:14 +02:00
parent bc006367fe
commit 93d242c404
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -162,7 +162,7 @@ func (a *AuthGoogleOAuth) Login(res http.ResponseWriter, r *http.Request) (user
// method. If no login using this method is possible the function
// needs to return nil.
func (a *AuthGoogleOAuth) LoginFields() (fields []plugins.LoginField) {
loginURL := a.getOAuthConfig().AuthCodeURL(a.AuthenticatorID())
loginURL := a.getOAuthConfig().AuthCodeURL(a.AuthenticatorID(), oauth2.AccessTypeOffline)
return []plugins.LoginField{
{