Update config to support OIDC and oauth2

This commit is contained in:
Mo Tarbin 2025-02-06 21:53:34 -05:00
parent 430f46ffee
commit 4c1b402137
8 changed files with 92 additions and 42 deletions

View file

@ -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")
}