Skip to content
This repository was archived by the owner on Apr 13, 2022. It is now read-only.

Commit 46039bf

Browse files
Merge pull request #147 from solid/dz_oidc
Add WebID-OIDC authentication method
2 parents df97c54 + bd8a1b7 commit 46039bf

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["es2015"]
3+
}

package.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@
2424
"postversion": "git push --follow-tags",
2525
"prepublish": "npm run test && npm run build"
2626
},
27-
"babel": {
28-
"presets": [
29-
"es2015"
30-
]
31-
},
3227
"repository": {
3328
"type": "git",
3429
"url": "https://github.com/solid/solid-client"
@@ -57,10 +52,11 @@
5752
"dependencies": {
5853
"rdflib": "^0.13.0",
5954
"shorthash": "0.0.2",
55+
"solid-auth-oidc": "0.0.5",
6056
"solid-auth-tls": "0.0.4",
6157
"solid-namespace": "^0.1.0",
6258
"solid-permissions": "^0.5.1",
63-
"solid-web-client": "^0.2.0"
59+
"solid-web-client": "^0.3.0"
6460
},
6561
"devDependencies": {
6662
"babel-cli": "^6.18.0",
@@ -69,7 +65,7 @@
6965
"json-loader": "^0.5.4",
7066
"nock": "^9.0.2",
7167
"qunit": "^0.9.0",
72-
"sinon": "^1.17.6",
68+
"sinon": "^2.1.0",
7369
"standard": "^5.4.1",
7470
"tape": "^4.4.0",
7571
"webpack": "^1.13.1"

src/index.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ https://github.com/solid/solid
3434
*/
3535

3636
const rdf = require('./util/rdf-parser')
37-
const webClient = require('solid-web-client')(rdf)
37+
const ClientAuthOIDC = require('solid-auth-oidc')
38+
const auth = new ClientAuthOIDC()
39+
const webClient = require('solid-web-client')(rdf, { auth })
3840
const ClientAuthTLS = require('solid-auth-tls')
39-
const auth = new ClientAuthTLS(webClient)
41+
const tls = new ClientAuthTLS(webClient)
4042
const identity = require('./identity')
4143
const ns = require('solid-namespace')(rdf)
4244
const acl = require('solid-permissions')
@@ -50,13 +52,14 @@ const Solid = {
5052
AppRegistration: require('./solid/app-registration'),
5153
appRegistry: require('./app-registry'),
5254
auth,
55+
tls,
5356
config: require('../config'),
54-
currentUser: auth.currentUser.bind(auth),
57+
currentUser: tls.currentUser.bind(tls),
5558
identity: require('./identity'),
56-
login: auth.login.bind(auth),
59+
login: tls.login.bind(tls),
5760
meta: require('./meta'),
5861
rdflib: rdf,
59-
signup: auth.signup.bind(auth),
62+
signup: tls.signup.bind(tls),
6063
status: require('./status'),
6164
typeRegistry: require('./type-registry'),
6265
vocab: ns,

webpack.config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,12 @@ module.exports = {
3535
fs: 'empty'
3636
},
3737
externals: {
38-
xhr2: 'XMLHttpRequest',
39-
xmlhttprequest: 'XMLHttpRequest'
38+
'xhr2': 'XMLHttpRequest',
39+
'xmlhttprequest': 'XMLHttpRequest',
40+
'node-fetch': 'fetch',
41+
'text-encoding': 'TextEncoder',
42+
'urlutils': 'URL',
43+
'webcrypto': 'crypto'
4044
},
4145
devtool: 'source-map'
4246
}

0 commit comments

Comments
 (0)