Skip to content

Commit 2ddc077

Browse files
committed
Merge branch 'support-new-oidc-rp-interface'
Updating to support new oidc-rp interface
2 parents 6e4db9c + b3dcca0 commit 2ddc077

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@solid/solid-auth-oidc",
3-
"version": "0.2.1",
3+
"version": "0.2.2",
44
"engines": {
55
"node": ">= 6.0"
66
},

src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,13 +406,13 @@ class ClientAuthOIDC {
406406
initUserFromResponse (client) {
407407
return client.validateResponse(this.currentLocation(), this.store)
408408
.then(response => {
409-
this.idToken = response.idToken
410-
this.accessToken = response.accessToken
409+
this.idToken = response.authorization.id_token
410+
this.accessToken = response.authorization.access_token
411411
this.session = response
412412

413413
this.clearAuthResponseFromUrl()
414414

415-
return this.extractAndValidateWebId(response.decoded)
415+
return this.extractAndValidateWebId(response.idClaims.sub)
416416
})
417417
.catch(error => {
418418
this.clearAuthResponseFromUrl()
@@ -433,7 +433,7 @@ class ClientAuthOIDC {
433433
* @return {string}
434434
*/
435435
extractAndValidateWebId (idToken) {
436-
let webId = idToken.payload.sub
436+
let webId = idToken
437437
this.webId = webId
438438
return webId
439439
}

test/auth.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,12 @@ describe('SolidAuthOIDC', () => {
318318
it('should validate the auth response', () => {
319319
let aliceWebId = 'https://alice.example.com/'
320320
let authResponse = {
321-
params: {
321+
authorization: {
322322
id_token: 'sample.id.token',
323323
access_token: 'sample.access.token'
324324
},
325-
decoded: {
326-
payload: { sub: aliceWebId }
325+
idClaims: {
326+
sub: aliceWebId
327327
}
328328
}
329329
let validateResponseStub = sinon.stub().resolves(authResponse)

0 commit comments

Comments
 (0)