-
Notifications
You must be signed in to change notification settings - Fork 89
[WIP] oauth2 basics -- do not merge yet #445
Conversation
scopes: "user", | ||
state: state | ||
}; | ||
query = Object.keys(queryArguments).map(function(key) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use url.format() for this
Currently implemented:
Because persona got replaced with oauth2, all the login tests were invalidated, so I removed those rather than try to rewrite them before the oauth2 loop is set up. Also, the teach-api.js code uses window.sessionStorage although that might need to be |
@toolness can you hook into this code to hook up the teach-api bits and do a sanity check on the code I wrote? (I'm sure there are util calls that I missed that streamline this code) |
Yeah, I'm on it! 👍 |
Ok, so we are busting things up a little bit differently now--since the OAuth2 client secret can only be stored in the teach API, I'm just doing all OAuthy stuff on the teach API (see mozilla/teach-api#11). I've added an Putting all the pieces together, the login flow will essentially work like this:
Phew. It's not particularly ideal, but I think we will be moving to a simpler solution once we actually give the teach site its own lightweight HTML-rendering server in v2 (we need to do this anyways to fully support our progressive enhancement strategy and some other things). I should also note that logout will actually likely follow a similar pattern, because for now we'll likely want logging out of the teach site to also log the user out of id.webmaker.org for usability reasons--see mozilla/id.webmaker.org#119 (comment) for more details on that. So, all that said, I'm closing this issue, but we can re-open it and rez the code if we later decide this is a better course of action! |
The initial code necessary to switch over to oauth2 based authentication rather than Persona arbitration
Implementing the following flow: