-
Notifications
You must be signed in to change notification settings - Fork 9
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
How do we want to handle multiple applications using auth? #34
Comments
@RobStallion thanks for opening this question! 🕺🏻 |
@nelsonic After reading programming-phx 1.4 my thoughts on how the auth app might work have changed some and I wanted to run my current thoughts passed you. They talk about separating a users sensitive and non-sensitive information into different places in the application and database. All the non-sensitive info (username, name, etc) is put in the users table while the sensitive info (email, password, etc) is put in the credentials table. Auth will:
ProsUsing this approach people using our module will:
ConsUsing this approach people using our module will
Please let me know your thoughts on any of this. This is my no means a finished idea. I also have a SO question open relating to how we would best implement something along these lines here. |
@RobStallion technically all user data is sensitive (according to GDPR) For our purposes all people-related data is sensitive. There is no advantage to splitting out "credentials" into its' own table as we will always select and decrypt the Name of the person (in order to display it in the UI) on a successful login. This is why a login flow diagram is necessary. 😉
We must figure out how to integrate this with Phoenix Sessions: phoenixframework.org/blog/sessions Please share the link to the StackOverflow question you opened on this when you can. |
My stack overflow question is here. |
Auth Diagram: https://docs.google.com/presentation/d/1PUKzbRQOEgHaOmaEheU7T3AHQhRT8mhGuqVKotEJkM0 |
Diagram is public on the interwebs so anyone should be able to see and edit it: @RobStallion if you have time to walk through the requirement for sending an email with a link to "verify email address" with @Cleop please go for it. the issue is: #35 (thanks!) |
@nelsonic I have created 2 basic phoenix applications called
So far I have been able to get
Next stepHave Once I am back in |
I have updated my test apps.
referer = get_req_header(conn, "referer")
render(conn, "new.html", referer: referer) and send it to the login form which has it as a hidden field. I log in as normal in the redirect(conn, external: referer)
def login(conn, user) do
conn
|> assign(:current_user, user)
|> put_session(:user_id, user.id)
|> configure_session(renew: true)
end Not sure on best way of sending this info back to |
@RobStallion worth opening a separate issue e.g. in |
Have been doing a fair amount of reading up on session vs token based auth...
And the impact that this could have on the way we want to build auth. The Phoenix book shows us how do auth with session auth, as seen in this comment above Guardian is a token based authentication library for use with Elixir applications and can be used to create JWTs. @nelsonic You mentioned that you did not want to use Guardian in this comment but said it was a closer approximation to what we need. I looked into how it is used in elixir apps (I have never used it personally so needed to look at some examples. The first link above is a good example) and they have made the implementation of it fairly similar to the examples from the book, e.g. they create an auth plug and pipe incoming requests that need to be verified through said plug. My current understanding of how JWTs are verified is through the "secret" in them. JWTs are made up of I think that we would be able to create an api this way fairly easily. E.g. a user would login by sending a post request to Once back in @nelsonic Let me know your thoughts |
The idea of using ueberauth/guardian is a non-starter for me. 👎 If you read through the docs for Guardian there is a lot of text but not a single diagram. 🤷♂ We can simplify our Auth by an order of magnitude by just building exactly what we need from scratch.
That's it. No more configuration or steps required. Get back to building the features of the Next: dwyl/app#268 (comment) |
GOTO: #42 |
My current understanding of how
auth
will work is that it will be a separate application that a calling app forwards requests to.If this is correct, how do we want to handle multiple applications using auth?
Would we deploy multiple versions of the auth app?
Would one auth application handle multiple calling apps?
The text was updated successfully, but these errors were encountered: