File tree 4 files changed +9
-9
lines changed
4 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -1292,7 +1292,7 @@ Function used to generate random client identifiers during dynamic client regist
1292
1292
1293
1293
_ ** default value** _ :
1294
1294
``` js
1295
- function idFactory () {
1295
+ function idFactory (ctx ) {
1296
1296
return nanoid ();
1297
1297
}
1298
1298
```
@@ -1432,7 +1432,7 @@ Function used to generate random client secrets during dynamic client registrati
1432
1432
1433
1433
_ ** default value** _ :
1434
1434
``` js
1435
- function secretFactory () {
1435
+ function secretFactory (ctx ) {
1436
1436
return base64url .encodeBuffer (crypto .randomBytes (64 )); // 512 base64url random bits
1437
1437
}
1438
1438
```
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ module.exports = {
93
93
const { oidc : { provider } } = ctx ;
94
94
const { idFactory, secretFactory } = instance ( provider ) . configuration ( 'features.registration' ) ;
95
95
const properties = { } ;
96
- const clientId = idFactory ( ) ;
96
+ const clientId = idFactory ( ctx ) ;
97
97
98
98
const rat = new provider . RegistrationAccessToken ( { clientId } ) ;
99
99
ctx . oidc . entity ( 'RegistrationAccessToken' , rat ) ;
@@ -108,7 +108,7 @@ module.exports = {
108
108
109
109
if ( secretRequired ) {
110
110
Object . assign ( properties , {
111
- client_secret : secretFactory ( ) ,
111
+ client_secret : secretFactory ( ctx ) ,
112
112
client_secret_expires_at : 0 ,
113
113
} ) ;
114
114
} else {
@@ -225,7 +225,7 @@ module.exports = {
225
225
226
226
if ( secretRequired ) {
227
227
Object . assign ( properties , {
228
- client_secret : secretFactory ( ) ,
228
+ client_secret : secretFactory ( ctx ) ,
229
229
client_secret_expires_at : 0 ,
230
230
} ) ;
231
231
} else {
Original file line number Diff line number Diff line change @@ -987,7 +987,7 @@ const DEFAULTS = {
987
987
* description: Function used to generate random client identifiers during dynamic
988
988
* client registration
989
989
*/
990
- idFactory : function idFactory ( ) {
990
+ idFactory : function idFactory ( ctx ) { // eslint-disable-line no-unused-vars
991
991
return nanoid ( ) ;
992
992
} ,
993
993
@@ -997,7 +997,7 @@ const DEFAULTS = {
997
997
* description: Function used to generate random client secrets during dynamic
998
998
* client registration
999
999
*/
1000
- secretFactory : function secretFactory ( ) {
1000
+ secretFactory : function secretFactory ( ctx ) { // eslint-disable-line no-unused-vars
1001
1001
return base64url . encodeBuffer ( crypto . randomBytes ( 64 ) ) ; // 512 base64url random bits
1002
1002
} ,
1003
1003
} ,
Original file line number Diff line number Diff line change @@ -886,8 +886,8 @@ export interface Configuration {
886
886
policies ?: {
887
887
[ key : string ] : ( ctx : KoaContextWithOIDC , metadata : ClientMetadata ) => CanBePromise < void | undefined > ;
888
888
} ;
889
- idFactory ?: ( ) => string ;
890
- secretFactory ?: ( ) => string ;
889
+ idFactory ?: ( ctx : KoaContextWithOIDC ) => string ;
890
+ secretFactory ?: ( ctx : KoaContextWithOIDC ) => string ;
891
891
} ;
892
892
893
893
registrationManagement ?: {
You can’t perform that action at this time.
0 commit comments