Fixed issue with scope not being added to token

This commit is contained in:
David J. Allen 2024-03-19 15:01:47 -06:00
parent 6b2218efbd
commit fddcc8d6af
No known key found for this signature in database
GPG key ID: 717C593FF60A2ACC
3 changed files with 9 additions and 4 deletions

View file

@ -38,6 +38,8 @@ func Login(config *Config, client *oauth.Client, provider *oidc.IdentityProvider
)
var button = MakeButton(authorizationUrl, "Login with "+client.Name)
var jwtClient = oauth.NewClient()
jwtClient.Scope = config.Authorization.Token.Scope
// authorize oauth client and listen for callback from provider
fmt.Printf("Waiting for authorization code redirect @%s/oidc/callback...\n", s.GetListenAddr())
@ -56,17 +58,17 @@ func Login(config *Config, client *oauth.Client, provider *oidc.IdentityProvider
Register: config.Authorization.Endpoints.Register,
},
JwtBearerParams: flows.JwtBearerFlowParams{
Client: oauth.NewClient(),
Client: jwtClient,
IdentityProvider: provider,
TrustedIssuer: &oauth.TrustedIssuer{
AllowAnySubject: false,
Issuer: s.Addr,
Subject: "opaal",
ExpiresAt: time.Now().Add(config.Authorization.TokenDuration),
ExpiresAt: time.Now().Add(config.Authorization.Token.Duration),
Scope: []string{},
},
Verbose: config.Options.Verbose,
Refresh: config.Authorization.TokenRefresh,
Refresh: config.Authorization.Token.Refresh,
},
}
err = s.Login(button, provider, client, params)