File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,11 @@ function assignDefaults (strategy, defaults) {
6
6
}
7
7
8
8
function addAuthorize ( strategy ) {
9
- // Get client_secret, client_id and token_endpoint
9
+ // Get client_secret, client_id, token_endpoint and audience
10
10
const clientSecret = strategy . client_secret
11
11
const clientID = strategy . client_id
12
12
const tokenEndpoint = strategy . token_endpoint
13
+ const audience = strategy . audience
13
14
14
15
// IMPORTANT: remove client_secret from generated bundle
15
16
delete strategy . client_secret
@@ -54,6 +55,7 @@ function addAuthorize (strategy) {
54
55
grant_type : grantType ,
55
56
response_type : responseType ,
56
57
redirect_uri : redirectUri ,
58
+ audience : audience ,
57
59
code
58
60
} ,
59
61
headers : {
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ module.exports = function auth0 (strategy) {
5
5
_scheme : 'oauth2' ,
6
6
authorization_endpoint : `https://${ strategy . domain } /authorize` ,
7
7
userinfo_endpoint : `https://${ strategy . domain } /userinfo` ,
8
- scope : [ 'openid' , 'profile' , 'email' ]
8
+ scope : [ 'openid' , 'profile' , 'email' ] ,
9
+ audience : strategy . domain
9
10
} )
10
11
}
Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ export default class Oauth2Scheme {
70
70
client_id : this . options . client_id ,
71
71
redirect_uri : this . _redirectURI ,
72
72
scope : this . _scope ,
73
+ audience : this . options . audience ,
73
74
state : randomString ( )
74
75
}
75
76
@@ -125,6 +126,7 @@ export default class Oauth2Scheme {
125
126
client_id : this . options . client_id ,
126
127
redirect_uri : this . _redirectURI ,
127
128
response_type : this . options . response_type ,
129
+ audience : this . options . audience ,
128
130
grant_type : this . options . grant_type
129
131
} )
130
132
} )
You can’t perform that action at this time.
0 commit comments