Implementing Auth0 using JWT Token only

So I’m trying to build API which works around JWT instead of sessions.

const app = express()

    authRequired: false,
    auth0Logout: true,
    secret: '',
    baseURL: 'http://localhost:8080',
    clientID: ''',
    issuerBaseURL: '',

    routes: {
        callback: "/auth/callback",
        login: "/auth/login",
        logout: "/auth/logout",


app.use("/health", healthController)

app.use("/auth/logout/callback", (req: Request, res: Response) => {
    res.json({message: req.oidc.isAuthenticated()})

app.get("/", (req:  Request, res: Response) => {

app.listen(8080, () => {
    console.log("Application up and running")

But on making call to /oauth/token it shows 404. Not able figure out I’m doing things correctly or not.

Hi @lakshya,

Welcome to the Auth0 Community!

Have you made sure that the request looks something like the following:

curl --request POST \
  --url 'https://YOUR_DOMAIN/oauth/token' \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data grant_type=authorization_code \
  --data 'client_id=YOUR_CLIENT_ID' \
  --data 'client_secret={yourClientSecret}' \
  --data 'code=yourAuthorizationCode}' \
  --data 'redirect_uri=https://YOUR_APP/callback'

Usually, a 404 error indicates that the domain URL cannot be found. Please check that the domain looks like, for example,

Please let me know how this goes for you.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.