-
Notifications
You must be signed in to change notification settings - Fork 56
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
Rework the Auth0 Guide #443
Comments
After following the current guide, I am running into what could be a severe problem. This is not an actual issue with the code, just with the guide, so I'm not opening a separate issue. After following the guide, my app is vulnerable to account takeover. Here are the steps to reproduce:
What I think we might need to doThe
If instead of:
We made the Then, the different Auth0 accounts would be considered different users in Ash. If they were later linked, the sub will not change. If you look at the example profiles on that page I linked, the primary and linked profiles have identical sub`s. So if an Ash user followed a guide that correlated the User resource to an I would love for someone with more Auth0 experience to weigh in. |
Yeah, this seems like an oversight on my part. We do have the |
No worries, it already felt like magic when I followed a guide, got auth working, and I have the absolute minimum amount of code to maintain. The One more reason to use the What do you think of a PR to the guide that changes the action to: create :register_with_auth0 do
argument :user_info, :map, allow_nil?: false
argument :oauth_tokens, :map, allow_nil?: false
upsert? true
upsert_identity :unique_auth0_id
# Required if you have token generation enabled.
change AshAuthentication.GenerateTokenChange
# Required if you have the `identity_resource` configuration enabled.
change AshAuthentication.Strategy.OAuth2.IdentityChange
change fn changeset, _ ->
user_info = Ash.Changeset.get_argument(changeset, :user_info)
changes = %{
"email" => Map.get(user_info, "email"),
"auth0_id" => Map.get(user_info, "sub")
}
Ash.Changeset.change_attributes(
changeset,
changes
)
end I would also wan to incorporate whatever I learn from here |
Absolutely. Rewrite the whole thing if you want 😂 |
@dewetblomerus were you still intending to work up a PR for this or should I add it to my backlog? |
Ensure users cannot login with uncomfirmed account team-alembic#443
Ensure oauth users cannot login with unconfirmed account team-alembic#443
Ensure oauth users cannot login with unconfirmed account team-alembic#443
Ensure oauth users cannot login with unconfirmed account team-alembic#443
Ensure oauth users cannot login with unconfirmed account team-alembic#443
Ensure oauth users cannot login with unconfirmed account team-alembic#443
Ensure oauth users cannot login with unconfirmed account team-alembic#443
Ensure oauth users cannot login with unconfirmed account team-alembic#443
Ensure oauth users cannot login with unconfirmed account team-alembic#443
Ensure oauth users cannot login with unconfirmed account team-alembic#443
Ensure oauth users cannot login with unconfirmed account #443
Based on feedback from multiple users, for example: https://elixirforum.com/t/onboarding-feedback-the-good-the-bad-and-the-ugly/58527/6?u=zachdaniel
Ultimately what should be done is that we should rework the guide to assume that the user has not already set up
ash_authentication
, and then highlight some areas that might be different if they already have set it up for password authentication, for example.The text was updated successfully, but these errors were encountered: