danestves / remix-auth-auth0

An Auth0Strategy for Remix Auth, based on the OAuth2Strategy
MIT License
121 stars 22 forks source link

No support for hosted (Auth0Lock.js) log in #92

Closed quuu closed 9 months ago

quuu commented 1 year ago

Describe the bug

Hi, noticed that the only way to authenticate via auth0 is to redirect to their universal login page

Some apps I've seen have been using auth0lock.js which lets them embed the universal login widget onto a self-hosted page https://github.com/auth0/lock

Will remix-auth-auth0 support a local embedded login?

Seems like right now the main capability is to just authenticator.authenticate('auth0', request) which always redirects to the universal login page?

Your Example Website or App

https://codesandbox.io/s/remix-run-examples-remix-auth-auth0-6rvc13

Steps to Reproduce the Bug or Issue

create a remix app, add remix auth0 auth, see there's no way to have the authenticator strategy use the local form

Expected behavior

Expected to be able to host the auth0 experience and authenticate

Screenshots or Videos

No response

Platform

Additional context

No response

sergiodxa commented 1 year ago

You don't need to use remix-auth-auth0 if you plan to use Auth0Lock.js, use the Auth0 SDK, grab the token and send it to a route where you can store it in a cookie/session yourself. There's nothing the Auth0Strategy for Remix Auth will give you in that case.

Note that, if you do that, you will have to ensure you correctly logout users on both the client-side SDK (it saves in localStorage) and the Remix app (cookie/session).