Skip to content

Commit 8d6a05c

Browse files
authored
Merge pull request #1675 from solid/oidcScopesSupported
OIDC scopes supported
2 parents 53b7c27 + 1b1416a commit 8d6a05c

File tree

18 files changed

+74
-16
lines changed

18 files changed

+74
-16
lines changed

default-templates/new-account/profile/card$.ttl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
solid:account </> ; # link to the account uri
1919
pim:storage </> ; # root storage
20+
solid:oidcIssuer <{{idp}}> ; # identity provider
2021

2122
ldp:inbox </inbox/> ;
2223

lib/models/account-manager.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,9 @@ class AccountManager {
334334
name: userData.name,
335335
externalWebId: userData.externalWebId,
336336
localAccountId: userData.localAccountId,
337-
webId: userData.webid || userData.webId || userData.externalWebId
337+
webId: userData.webid || userData.webId || userData.externalWebId,
338+
idp: this.host.serverUri
338339
}
339-
340340
if (userConfig.username) {
341341
userConfig.username = userConfig.username.toLowerCase()
342342
}
@@ -360,6 +360,9 @@ class AccountManager {
360360
} else { // no username - derive it from web id
361361
if (userConfig.externalWebId) {
362362
userConfig.username = userConfig.externalWebId
363+
364+
// TODO find oidcIssuer from externalWebId
365+
// removed from idp https://github.com/solid/node-solid-server/pull/1566
363366
} else {
364367
userConfig.username = this.usernameFromWebId(userConfig.webId)
365368
}

lib/models/account-template.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ class AccountTemplate {
7575
const substitutions = {
7676
name: userAccount.displayName,
7777
webId: userAccount.webId,
78-
email: userAccount.email
78+
email: userAccount.email,
79+
idp: userAccount.idp
7980
}
8081

8182
return substitutions

lib/models/user-account.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class UserAccount {
2424
this.email = options.email
2525
this.externalWebId = options.externalWebId
2626
this.localAccountId = options.localAccountId
27+
this.idp = options.idp
2728
}
2829

2930
/**

package-lock.json

Lines changed: 26 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
"dependencies": {
6262
"@fastify/busboy": "^1.0.0",
6363
"@solid/acl-check": "^0.4.5",
64-
"@solid/oidc-auth-manager": "^0.24.1",
65-
"@solid/oidc-op": "0.11.5",
64+
"@solid/oidc-auth-manager": "^0.24.2",
65+
"@solid/oidc-op": "^0.11.6",
6666
"async-lock": "^1.3.0",
6767
"body-parser": "^1.19.1",
6868
"bootstrap": "^3.4.1",
@@ -108,7 +108,7 @@
108108
"text-encoder-lite": "^2.0.0",
109109
"the-big-username-blacklist": "^1.5.2",
110110
"ulid": "^2.3.0",
111-
"urijs": "^1.19.7",
111+
"urijs": "^1.19.10",
112112
"uuid": "^8.3.2",
113113
"valid-url": "^1.0.9",
114114
"validator": "^13.7.0",

test/integration/account-manager-test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ describe.skip('AccountManager', () => {
132132
.then(() => {
133133
const profile = fs.readFileSync(path.join(accountDir, '/profile/card$.ttl'), 'utf8')
134134
expect(profile).to.include('"Alice Q."')
135+
expect(profile).to.include('solid:oidcIssuer')
136+
expect(profile).to.include('<https://localhost:8443>')
135137

136138
const rootAcl = fs.readFileSync(path.join(accountDir, '.acl'), 'utf8')
137139
expect(rootAcl).to.include('<mailto:alice@')

test/integration/account-template-test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ describe.skip('AccountTemplate', () => {
5050
.then(() => {
5151
const profile = fs.readFileSync(path.join(accountPath, '/profile/card$.ttl'), 'utf8')
5252
expect(profile).to.include('"Alice Q."')
53+
expect(profile).to.include('solid:oidcIssuer')
54+
expect(profile).to.include('<https://example.com>')
5355

5456
const rootAcl = fs.readFileSync(path.join(accountPath, '.acl'), 'utf8')
5557
expect(rootAcl).to.include('<mailto:alice@')

test/resources/accounts-acl/config/templates/new-account/profile/card

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
solid:account </> ; # link to the account uri
1919
pim:storage </> ; # root storage
20+
solid:oidcIssuer <{{idp}}> ; # identity provider
21+
2022

2123
ldp:inbox </inbox/> ;
2224

test/resources/accounts-acl/db/oidc/op/provider.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"issuer": "https://localhost:7777",
33
"jwks_uri": "https://localhost:7777/jwks",
4+
"scopes_supported": [
5+
"openid",
6+
"offline_access"
7+
],
48
"response_types_supported": [
59
"code",
610
"code token",

0 commit comments

Comments
 (0)