# Implementing Auth0 using JWT Token only

**URL:** <https://community.auth0.com/t/implementing-auth0-using-jwt-token-only/98370>\
**Category:** JWT.io\
**Tags:** jwt\
**Created:** [January 17, 2023, 6:46pm UTC](https://community.auth0.com/t/implementing-auth0-using-jwt-token-only/98370 "2023-01-17T18:46:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lakshya](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lakshya/32/42749_2.png) [@lakshya](https://community.auth0.com/u/lakshya)\
**Post date:** [January 17, 2023, 6:46pm UTC](https://community.auth0.com/t/implementing-auth0-using-jwt-token-only/98370/1 "2023-01-17T18:46:32Z")

</div>

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

```auto

const app = express()

app.use(auth({
    authRequired: false,
    auth0Logout: true,
    secret: '',
    baseURL: 'http://localhost:8080',
    clientID: ''',
    issuerBaseURL: '',

    routes: {
        callback: "/auth/callback",
        login: "/auth/login",
        logout: "/auth/logout",
        postLogoutRedirect:"http://localhost:8080/auth/logout/callback"
    }

  }));

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) => {
    res.redirect("http://localhost:3000/dashboard")
})

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.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [January 17, 2023, 9:11pm UTC](https://community.auth0.com/t/implementing-auth0-using-jwt-token-only/98370/3 "2023-01-17T21:11:11Z")

</div>

Hi @lakshya,

Welcome to the Auth0 Community!

> [@lakshya](#):
>
> making call to `/oauth/token` it shows 404

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

```auto
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 `https://TENANT.REGION.auth0.com`, for example, `https://exampletenant.us.auth0.com`.

Please let me know how this goes for you.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [January 31, 2023, 9:11pm UTC](https://community.auth0.com/t/implementing-auth0-using-jwt-token-only/98370/4 "2023-01-31T21:11:39Z")

</div>

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