File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,8 @@ const httpValidator = new HttpValidator({
7272 )
7373 }
7474 ],
75- issuer: ' eyevinn'
75+ issuer: ' eyevinn' ,
76+ audience: [' one' , ' two' ] // Optional
7677});
7778
7879const server = http .createServer ((req , res ) => {
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ interface HttpValidatorKey {
99export interface HttpValidatorOptions {
1010 keys : HttpValidatorKey [ ] ;
1111 issuer : string ;
12+ audience ?: string [ ] ;
1213}
1314
1415export interface HttpResponse {
@@ -31,6 +32,7 @@ export interface HttpResponse {
3132 * }
3233 * ],
3334 * issuer: 'eyevinn'
35+ * audience: ['one', 'two'] // Optional
3436 * });
3537 * const result = await httpValidator.validateHttpRequest(
3638 * request,
@@ -63,7 +65,8 @@ export class HttpValidator {
6365 try {
6466 await validator . validate ( token , 'mac' , {
6567 kid,
66- issuer : this . opts . issuer
68+ issuer : this . opts . issuer ,
69+ audience : this . opts . audience
6770 } ) ;
6871 return { status : 200 } ;
6972 } catch ( err ) {
You can’t perform that action at this time.
0 commit comments