File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 2626 */
2727'use strict'
2828const RelyingParty = require ( '@trust/oidc-rp' )
29+ const PoPToken = require ( '@trust/oidc-rp/lib/PoPToken' )
2930const providerSelectPopupSource = require ( './provider-select-popup' )
3031
3132// URI parameter types
@@ -388,6 +389,10 @@ class ClientAuthOIDC {
388389 return this . sendAuthRequest ( client )
389390 }
390391
392+ issuePoPTokenFor ( uri , session ) {
393+ return PoPToken . issueFor ( uri , session )
394+ }
395+
391396 /**
392397 * Validates the auth response in the current uri, initializes the current
393398 * user's ID Token and Access token, and returns the user's WebID
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ chai.should()
1717const expect = chai . expect
1818
1919const SolidAuthOIDC = require ( '../src/index' )
20+ const PoPToken = require ( '@trust/oidc-rp/lib/PoPToken' )
2021
2122describe ( 'SolidAuthOIDC' , ( ) => {
2223 var auth
@@ -494,4 +495,25 @@ describe('SolidAuthOIDC', () => {
494495 expect ( url ) . to . equal ( 'https://example.com/' )
495496 } )
496497 } )
498+
499+ describe ( 'issuePoPTokenFor()' , ( ) => {
500+ before ( ( ) => {
501+ sinon . stub ( PoPToken , 'issueFor' ) . resolves ( )
502+ } )
503+
504+ after ( ( ) => {
505+ PoPToken . issueFor . restore ( )
506+ } )
507+
508+ it ( 'should invoke PoPToken.issueFor' , ( ) => {
509+ let auth = new SolidAuthOIDC ( )
510+ let uri = 'https://rs.com'
511+ let session = { }
512+
513+ return auth . issuePoPTokenFor ( uri , session )
514+ . then ( ( ) => {
515+ expect ( PoPToken . issueFor ) . to . have . been . calledWith ( uri , session )
516+ } )
517+ } )
518+ } )
497519} )
You can’t perform that action at this time.
0 commit comments