Update config to support OIDC and oauth2
This commit is contained in:
parent
430f46ffee
commit
4c1b402137
8 changed files with 92 additions and 42 deletions
|
@ -44,13 +44,12 @@ func (i *IdentityProvider) ExchangeToken(ctx context.Context, code string) (stri
|
|||
TokenURL: i.config.TokenURL,
|
||||
},
|
||||
}
|
||||
|
||||
token, err := conf.Exchange(ctx, code)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
accessToken, ok := token.Extra("access_token").(string)
|
||||
accessToken, ok := token.AccessToken, token.Valid()
|
||||
if !ok {
|
||||
return "", errors.New("access token not found")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue