File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,14 @@ describe('LineAdapter', function () {
6363 adapter . validateOptions ( validOptions ) ;
6464 } ) ;
6565
66+ it ( 'should throw an error if LINE auth is not configured' , async function ( ) {
67+ adapter = new LineAdapter . constructor ( ) ;
68+
69+ await expectAsync (
70+ adapter . verifyIdToken ( { id_token : 'the_token' } )
71+ ) . toBeRejectedWithError ( 'Line auth is not configured.' ) ;
72+ } ) ;
73+
6674 it ( 'should throw an error if id_token is missing' , async function ( ) {
6775 await expectAsync ( adapter . verifyIdToken ( { } ) ) . toBeRejectedWithError (
6876 'id token is invalid for this user.'
@@ -160,6 +168,14 @@ describe('LineAdapter', function () {
160168 'Line clientSecret is required to verify HS256 id_token.'
161169 ) ;
162170 } ) ;
171+
172+ it ( 'should reject an unsupported signing algorithm' , async function ( ) {
173+ spyOn ( authUtils , 'getHeaderFromToken' ) . and . returnValue ( { alg : 'RS256' } ) ;
174+
175+ await expectAsync ( adapter . verifyIdToken ( { id_token : 'the_token' } ) ) . toBeRejectedWithError (
176+ 'Unsupported Line id_token signing algorithm: RS256'
177+ ) ;
178+ } ) ;
163179 } ) ;
164180
165181 describe ( 'getAccessTokenFromCode' , function ( ) {
You can’t perform that action at this time.
0 commit comments