Skip to content
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

Document Auth0 log out process #346

Open
guglielmobartelloni opened this issue Jul 6, 2023 · 1 comment
Open

Document Auth0 log out process #346

guglielmobartelloni opened this issue Jul 6, 2023 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@guglielmobartelloni
Copy link

When a user tries to logut from a phoenix application using auth0 strategy for ash, the session will be cleared but auth0 is not notified about the logout.

A workaround that I found is to redirect the user to https://[YOUR_APP_ON_AUTH0]/v2/logout?returnTo=http%3A%2F%2F[YOUR_APP_HOME_PAGE] endpoint when loggin out. This is a sample code from my authcontroller

  def sign_out(conn, _params) do

    conn
    |> clear_session()
    |> redirect(external: "https://[auth0_endpoint]/v2/logout?returnTo=#{AppWeb.Endpoint.url()}")
  end

It would be helpful if the ash_authentication feature could automatically initiate a call to the auth0 endpoint. Additionally, it would be beneficial to include this workaround in the documentation, as new users of ash might not be aware of this functionality, just like myself.

@jimsynz
Copy link
Collaborator

jimsynz commented Nov 15, 2023

I think that we should add this to the documentation and maybe expose a function to generate the URL for you from the Auth0 strategy.

@jimsynz jimsynz added documentation Improvements or additions to documentation good first issue Good for newcomers labels Nov 15, 2023
@jimsynz jimsynz changed the title Proper logout from auth0 Document Auth0 log out process Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants