# Using Auth0 to secure my express backend

**URL:** <https://community.auth0.com/t/using-auth0-to-secure-my-express-backend/70663>\
**Category:** Get Help\
**Tags:** express, auth0\
**Created:** [October 2, 2021, 1:37am UTC](https://community.auth0.com/t/using-auth0-to-secure-my-express-backend/70663 "2021-10-02T01:37:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dashboardagencyllc](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dashboardagencyllc/32/26404_2.png) [@dashboardagencyllc](https://community.auth0.com/u/dashboardagencyllc)\
**Post date:** [October 2, 2021, 1:37am UTC](https://community.auth0.com/t/using-auth0-to-secure-my-express-backend/70663/1 "2021-10-02T01:37:33Z")

</div>

I’m new to Auth0 so please bear with me. I have a static front-end which is hosted in a basic CDN like netlify. I have an express back-end which I serve data to the front-end/process requests from the front-end. I currently have my application set as web-application, utilizing the express-openid-connect middleware which I have the basic /login /logout endpoints. That’s where my “knowledge” ends. I am currently extremely confused as how to

- redirect to [myfrontend.com](http://myfrontend.com) instead of [myfrontend.com/callback](http://myfrontend.com/callback)
- when I make requests from the front end such as fetch(‘[mybackend.com/users/@me](http://mybackend.com/users/@me)’) I get an unauthenticated error (which I throw myself but the request is definitely not authenticated)

Any help would be appreciated, thanks in advance.

---

<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:** [October 4, 2021, 10:51pm UTC](https://community.auth0.com/t/using-auth0-to-secure-my-express-backend/70663/4 "2021-10-04T22:51:59Z")

</div>

Hi @dashboardagencyllc,

Welcome to the Auth0 Community!

I understand that you have some clarifying questions about how to use Auth0.

First, to redirect your users to your desired callback URL you will need to specify the `redirect_uri` in the `/authorize` request and then include that URL in the **Allowed Callback List** in your Application on the Auth0 [Dashboard](https://manage.auth0.com/#/applications/).

Below is an example of the `/authorize` request:

```auto
https://YOUR_DOMAIN/authorize?
    response_type=code&
    client_id=YOUR_CLIENT_ID&
    redirect_uri=https://myfrontend.com&
    scope=SCOPE&
    state=STATE

```

See our docs on [redirecting users after login](https://auth0.com/docs/login/redirect-users-after-login) for more details.

Next, have you had the chance to take a look at Auth0’s Quickstarts for Node.js (express)?

You can find the Quickstarts in your Auth0 [Dashboard \> Applications \> YOUR APP \> Quickstart](https://manage.auth0.com/#/applications/).

Alternatively, you can find the equivalent Quickstart in our documentation [here](https://auth0.com/docs/quickstart/webapp/express).

Lastly, you may find this sample express web app repo useful: [https://github.com/auth0-samples/auth0-express-webapp-sample](https://github.com/auth0-samples/auth0-express-webapp-sample).

Hoped this helps! Please let me know there are any questions. I would be happy to clarify.

Thank you.

---

<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:** [December 6, 2021, 10:58pm UTC](https://community.auth0.com/t/using-auth0-to-secure-my-express-backend/70663/5 "2021-12-06T22:58:21Z")

</div>

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