-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API for oAuth plugin #75
Comments
I may be misremembering this, but I think what we discussed… 2 years ago 0_o was something like:
That's what we want, right? |
Ideally, you wouldn't need to handle any tokens yourself. hoodie.account.signInWith('github').done(function(username){
console.log('Hey there, ', username)
}) And options can be passed as a second parameter, to request only a certain scope hoodie.account.signInWith('github', {scopes: ['user:email']}).done(function(username){
console.log('Hey there, ', username)
}) |
Ok, but it definitely should be available in the user object in case the dev wants to do anything with it in the client, for whatever reason. Anway, the two main contenders for hapi libraries to build this upon seem to be:
(Also updated my previous post with the provider registration step) |
@janl you mentioned, we already decided which hapi plugin we want to use? |
We'll use Bell. @christophwitzko and I talked the flow through.
We came up with some suggestions for hoodie.account.user JSON scheme, because we have 3 ways to verify the application.
We thought about also saving things like |
Maybe we want |
we can get some ideas from here: https://oauth.io/home |
Can't we open it in a new window, so that we can inform the host about error / success? Does it need to be a redirect? |
See the dream api for Basically, we could define user accounts using JSON Schema, with an additional |
it's |
Yeah, I wonder if this is app-specific, or if we can pre-configure on what to do with it. We could also store meta data coming from 3rd parties like GitHub, Facebook in special user properties? If I don't have a an account yet, and I do How about something like this? hoodie.account.signInWith("github", {
// available properties for each provider should be documented somewhere :)
matchProperties: {
username: 'email',
fullname: 'name',
avatarUrl: 'avatar'
},
// other options
}) ? |
That is very interesting, I haven't thought about this use case yet, I thought it might be out of scope. I thought we only think about signing the user in, without any background integrations. But thist makes totally sense, and we should think it trough. I guess we need to somehow expose them to plugins? E.g. I could imagine to have a plugin that checks all user accounts every few hours, and if they are "connected" to dropbox, I'd load their data and back it up to dropbox? Something like that? Maybe we should discuss the back-end / plugin api as well? |
Not found another solution for this yet.
cool!
I think, we could do this for This would mean:
+1 on that
For the schema we thought about:
We should generalize the service data, we want to store. |
I'm still not convinced that we need both, signInWith and signUpWith. From an app user perspective, here's a typical example from buffer.com There is only one button to sign in with Twitter / Facebook / LinkedIn. And that buttons works no matter whether the account exists already or not.
I'd only take information from |
Ok, I'm re-convinced that Adding custom data to an oAuth user would have to be a two-step process anyway, first auth, then add custom data, and at that point the app logic can decide whether to even show the inputs for the custom data based on whether it exists in the user doc already. So that should work. |
I don't think, we should have any inputs for the custom service data. I think a getter would be enough for that. |
Absolutely, inputs would be app logic too, was just an example :) |
Cool :) |
I'd love start the discussion on the oAuth plugin including scope, dependencies and API.
What are your thoughts already?
hoodie.account.set("twitter")
)How much will this plugin depend on the new https://github.com/hoodiehq/hoodie-account-server/tree/api?
repo: https://github.com/hoodiehq/hoodie-plugin-oAuth
docs:
Github: https://developer.github.com/v3/oauth/
Twitter: https://dev.twitter.com/oauth/overview/introduction
Facebook: https://developers.facebook.com/docs/facebook-login/login-flow-for-web/v2.4
Google: https://developers.google.com/identity/protocols/OAuth2
cc @janl @christophwitzko @espy @boennemann @gr2m
The text was updated successfully, but these errors were encountered: