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

Add WebID-OIDC authentication method#147

Merged
dmitrizagidulin merged 5 commits intomasterfrom
dz_oidc
Apr 13, 2017
Merged

Add WebID-OIDC authentication method#147
dmitrizagidulin merged 5 commits intomasterfrom
dz_oidc

Conversation

@dmitrizagidulin
Copy link
Contributor

Implements issue #92.

Major changes:

  • solid.login() and solid.currentUser() are switched over to use the WebID-OIDC auth client instead of WebID-TLS.
  • TLS-based login() and currentUser() are still accessible via solid.tls.login() and solid.tls.currentUser(), though these will be deprecated in future versions.
  • solid.logout() is implemented.

@dmitrizagidulin
Copy link
Contributor Author

cc @dan-f / @timbl for review.

src/index.js Outdated
config: require('../config'),
currentUser: auth.currentUser.bind(auth),
identity: require('./identity'),
login: auth.login.bind(auth),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see any tests in solid-auth-oidc for the login function, so I don't like the idea of swapping out a tested client.login for an untested one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right-o, I will be adding tests to both login & logout.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added unit tests for login & logout, to solid-auth-oidc.

src/index.js Outdated
currentUser: auth.currentUser.bind(auth),
identity: require('./identity'),
login: auth.login.bind(auth),
logout: auth.logout.bind(auth),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same goes for logout - no tests.

'node-fetch': 'fetch',
'text-encoding': 'TextEncoder',
'urlutils': 'URL',
'webcrypto': 'crypto'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are all these externals necessary? They're declared identically in solid-auth-oidc's webpack config.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd love to find a way to not include them; haven't been able to get it to work without.

@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind also removing this in the package.json - https://github.com/solid/solid-client/blob/master/package.json#L27-L30

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing, will remove.

@dmitrizagidulin
Copy link
Contributor Author

@dan-f Any other comments to address before this is merged?

@dan-f
Copy link
Contributor

dan-f commented Apr 12, 2017

Let me take a look at those tests.

@dan-f
Copy link
Contributor

dan-f commented Apr 12, 2017

Actually, is there a demo app to test this UI?

@dmitrizagidulin
Copy link
Contributor Author

@dan-f
Copy link
Contributor

dan-f commented Apr 12, 2017

That page 404s

@dmitrizagidulin
Copy link
Contributor Author

@dan-f
Copy link
Contributor

dan-f commented Apr 12, 2017

Nice. So when I click "log out" and refresh the page it appears that I'm still logged in.

@dan-f
Copy link
Contributor

dan-f commented Apr 12, 2017

I'm also seeing an XHR for a "/goodbye" HTML page which seems a bit strange

@dan-f
Copy link
Contributor

dan-f commented Apr 12, 2017

So after further discussion, it looks like we'll namespace the new auth method separately rather than replace solid.login pending further integration testing

@dmitrizagidulin
Copy link
Contributor Author

@dan-f - the oidc auth is now namespaced, the default login & currentUser is re-bound to TLS.

@dan-f
Copy link
Contributor

dan-f commented Apr 13, 2017

ok 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants