Call end_session_endpoint in IDP provider when login out from Console (#2476)

This commit is contained in:
Javier Adriel
2022-12-05 18:14:41 -06:00
committed by GitHub
parent 262a601d21
commit e7a41b4cd9
13 changed files with 243 additions and 7 deletions

View File

@@ -37,6 +37,7 @@ type ProviderConfig struct {
Userinfo bool
RedirectCallbackDynamic bool
RedirectCallback string
EndSessionEndpoint string
RoleArn string // can be empty
}

View File

@@ -110,6 +110,7 @@ type Provider struct {
IDPName string
// if enabled means that we need extrace access_token as well
UserInfo bool
RefreshToken string
oauth2Config Configuration
provHTTPClient *http.Client
}
@@ -319,6 +320,7 @@ func (client *Provider) VerifyIdentity(ctx context.Context, code, state, roleARN
getWebTokenExpiry := func() (*credentials.WebIdentityToken, error) {
customCtx := context.WithValue(ctx, oauth2.HTTPClient, client.provHTTPClient)
oauth2Token, err := client.oauth2Config.Exchange(customCtx, code)
client.RefreshToken = oauth2Token.RefreshToken
if err != nil {
return nil, err
}