mirror of
https://github.com/davidallendj/opaal.git
synced 2025-12-20 03:27:02 -07:00
Added audience override for token sent to authorization server
This commit is contained in:
parent
20ba7bc735
commit
c67c6f75a2
3 changed files with 12 additions and 3 deletions
|
|
@ -23,6 +23,7 @@ type JwtBearerFlowParams struct {
|
|||
// IdentityProvider *oidc.IdentityProvider
|
||||
TrustedIssuer *oauth.TrustedIssuer
|
||||
Client *oauth.Client
|
||||
Audience []string
|
||||
Refresh bool
|
||||
Verbose bool
|
||||
KeyPath string
|
||||
|
|
@ -143,6 +144,11 @@ func NewJwtBearerFlow(eps JwtBearerFlowEndpoints, params JwtBearerFlowParams) (s
|
|||
payload["exp"] = time.Now().Add(time.Second * 3600 * 16).Unix()
|
||||
payload["sub"] = "opaal"
|
||||
|
||||
// if an "audience" value is set, then override the token endpoint value
|
||||
if len(params.Audience) > 0 {
|
||||
payload["aud"] = params.Audience
|
||||
}
|
||||
|
||||
// include the offline_access scope if refresh tokens are enabled
|
||||
if params.Refresh {
|
||||
v, ok := payload["scope"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue