added option to retrieve the OIDC user info from the id_token payload
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"maps"
|
||||
"net/http"
|
||||
|
||||
"golang.org/x/oauth2"
|
||||
@@ -21,6 +22,7 @@ type BaseProvider struct {
|
||||
userInfoURL string
|
||||
scopes []string
|
||||
pkce bool
|
||||
extra map[string]any
|
||||
}
|
||||
|
||||
// Context implements Provider.Context() interface method.
|
||||
@@ -123,6 +125,16 @@ func (p *BaseProvider) SetUserInfoURL(url string) {
|
||||
p.userInfoURL = url
|
||||
}
|
||||
|
||||
// Extra implements Provider.Extra() interface method.
|
||||
func (p *BaseProvider) Extra() map[string]any {
|
||||
return maps.Clone(p.extra)
|
||||
}
|
||||
|
||||
// SetExtra implements Provider.SetExtra() interface method.
|
||||
func (p *BaseProvider) SetExtra(data map[string]any) {
|
||||
p.extra = data
|
||||
}
|
||||
|
||||
// BuildAuthURL implements Provider.BuildAuthURL() interface method.
|
||||
func (p *BaseProvider) BuildAuthURL(state string, opts ...oauth2.AuthCodeOption) string {
|
||||
return p.oauth2Config().AuthCodeURL(state, opts...)
|
||||
|
||||
Reference in New Issue
Block a user