Skip to content
This repository has been archived by the owner on Oct 24, 2022. It is now read-only.

MIT OpenID proof of concept #146

Closed
wants to merge 2 commits into from
Closed

MIT OpenID proof of concept #146

wants to merge 2 commits into from

Conversation

JPrevost
Copy link
Member

This is an alternate example of authentication example for #127.

It doesn't use any libraries, and instead builds a client ourselves. On the plus side, this allows us to easily configure our app to use MIT's pilot authentication service. On the downside, there are likely error states and such we'll still need to build in support for that a public library may already handle for us.

What this does:

  • if a user goes to /login/ and clicks the Sign In link they'll be taken to MIT's login page where they can signin and choose what information to return to our app (we ask for 3 types of info but they can choose to NOT allow specific pieces so we'll need to present dialogs for things where they make sense... like maybe we insist they provide an email even though MIT allows them to restrict that form our app, etc).
  • Once they are returned to our app, we request a token.
  • We then use that token to get their profile information... and for now just dump it on the screen. We'd actually do some DB lookups, create accounts, whatever makes sense in our auth flow from here.

WS.url("https://oidc.mit.edu/userinfo").
withHeaders(HeaderNames.AUTHORIZATION -> ("Bearer " + s"$authToken")).
get().map { response =>
Ok(response.json)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is where we'd actually do something useful like DB lookups to see if they have an account and if so log them in, or if not create an account for them (possibly prompting for more info, etc).

@JPrevost
Copy link
Member Author

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.48%) to 23.86% when pulling ad817de47089a5aa16ff84905aaa0ac2de46bf6c on 127_oath2 into 7f6d2c6 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.03%) to 25.14% when pulling c202a31 on 127_oath2 into 2c89e4f on master.

@JPrevost JPrevost closed this Apr 3, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants