Skip to content

Commit cf47324

Browse files
author
Anis Eleuch
committed
openid: Gather the refresh token if found.
With this commit, when the openid login page sends the refresh token in the login redirection url, the code will get it. This is helpful to support refresh openid user claims routine.
1 parent 076b803 commit cf47324

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/auth/idp/oauth2/provider.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,15 @@ func (client *Provider) VerifyIdentity(ctx context.Context, code, state, roleARN
321321
return nil, errors.New("missing access_token")
322322
}
323323
token.AccessToken = accessToken.(string)
324+
refreshToken := oauth2Token.Extra("refresh_token")
325+
if refreshToken != nil {
326+
token.RefreshToken = refreshToken.(string)
327+
} else {
328+
// TODO in Nov 2026 : add an error when the refresh token is not found.
329+
// This is not done yet because users may not have access_offline scope
330+
// and this may break their deployments
331+
}
332+
324333
}
325334
return token, nil
326335
}

0 commit comments

Comments
 (0)