Use JSON Web Tokens with client-side applications
Because JSON Web Tokens (JWTs) are stateless (that is, the app that consumes them cares only about its contents, not any of its previous states), this is one of the easiest scenarios to test locally. You can obtain for testing using any of the following methods:- Create a test user for a database connection, and programmatically log the user in. Essentially, you are using the Resource Owner Password Flow. For detailed implementation instructions, read Call Your API Using the Resource Owner Password Flow.
- Use a browser bot to play the role of a user, log in and retrieve a JWT.
Use sessions with server-side applications
Unless your server-side application allows the generation of artificial sessions for testing, you’ll need a way to perform a login through Auth0 manually. For a high-level overview of how to do this, see Authorization Code Flow. For detailed implementation instructions, see our tutorial, Add Login Using the Authorization Code Flow.Use local domains with Auth0
If you’re developing your application locally, you can uselocalhost
and other domains inaccessible by Auth0 (such as those on an intranet) as callback URLs. For example, during development, you could use http://localhost:3000/callback
as the callback URL.
- Go to Auth0 Dashboard > Applications > Applications and click the application.
- Add the URL to the Allowed Callback URLs list.