# \#nodejs

**URL:** https://community.auth0.com/tag/nodejs/127.md

[Latest](https://community.auth0.com/latest.md) · [Categories](https://community.auth0.com/categories.md) · [Tags](https://community.auth0.com/tags.md)

---

## [Refresh token implementation](https://community.auth0.com/t/refresh-token-implementation/99767)

<div class="topic-metadata">

**Author:** [@IsoardiMarius](https://community.auth0.com/u/IsoardiMarius)\
**Replies:** 2\
**Last updated:** [February 14, 2023, 10:13am UTC](https://community.auth0.com/t/refresh-token-implementation/99767 "2023-02-14T10:13:42Z")

</div>

Hello everyone, I thank you in advance for your patience and for the time you give me. I’ll explain my problem to you, I’d like to set up a refresh token, because currently, when a user logs in, the lifespan of the toke…

---

## [Login in production not working](https://community.auth0.com/t/login-in-production-not-working/39057)

<div class="topic-metadata">

**Author:** [@ikemnomso](https://community.auth0.com/u/ikemnomso)\
**Replies:** 7\
**Last updated:** [January 14, 2023, 1:14am UTC](https://community.auth0.com/t/login-in-production-not-working/39057 "2023-01-14T01:14:42Z")

</div>

I’m trying to deploy my nodes app on Heroku. I can login in locally but on the deployed app, after clicking login it just loops back to the login page. My Auth0 log shows Successful login but the app doesn’t redirect to …

---

## [Check Auth0 API Status using NodeJS](https://community.auth0.com/t/check-auth0-api-status-using-nodejs/93765)

<div class="topic-metadata">

**Author:** [@scottcp](https://community.auth0.com/u/scottcp)\
**Replies:** 9\
**Last updated:** [November 7, 2022, 10:55pm UTC](https://community.auth0.com/t/check-auth0-api-status-using-nodejs/93765 "2022-11-07T22:55:49Z")

</div>

Hi, I have an application that logs the user in via Auth0. The user is redirected to a web browser to log in. I want to do a check to verify the service is available before sending the user so the user can be alerted if…

---

## [Typescript express-jwt - This expression is not callable Error](https://community.auth0.com/t/typescript-express-jwt-this-expression-is-not-callable-error/86147)

<div class="topic-metadata">

**Author:** [@mez](https://community.auth0.com/u/mez)\
**Replies:** 1\
**Last updated:** [September 3, 2022, 12:29am UTC](https://community.auth0.com/t/typescript-express-jwt-this-expression-is-not-callable-error/86147 "2022-09-03T00:29:34Z")

</div>

Defining the constant Blockquote export const checkJwt = jwt({ secret: jwksRsa.expressJwtSecret({ cache: true, rateLimit: true, jwksRequestsPerMinute: 5, jwksUri: https://${process.env.AUTH0\_DOMAIN}/.well-known/j…

---

## [Having trouble calling the Management API from my Node backend using an M2M token](https://community.auth0.com/t/having-trouble-calling-the-management-api-from-my-node-backend-using-an-m2m-token/88754)

<div class="topic-metadata">

**Author:** [@robliou01](https://community.auth0.com/u/robliou01)\
**Replies:** 1\
**Last updated:** [August 16, 2022, 3:33pm UTC](https://community.auth0.com/t/having-trouble-calling-the-management-api-from-my-node-backend-using-an-m2m-token/88754 "2022-08-16T15:33:33Z")

</div>

Hi! I’m curious what is a working way to get my SPA (front-end) + Node (back-end) setup to call the Management API using an M2M token without generating a CORS error? Using the Auth0 tutorials, I can authenticate with …

---

## [NextJs Cookie lifetime - Security concerns?](https://community.auth0.com/t/nextjs-cookie-lifetime-security-concerns/86749)

<div class="topic-metadata">

**Author:** [@theo.camboulive](https://community.auth0.com/u/theo.camboulive)\
**Replies:** 2\
**Last updated:** [July 12, 2022, 10:56am UTC](https://community.auth0.com/t/nextjs-cookie-lifetime-security-concerns/86749 "2022-07-12T10:56:36Z")

</div>

Quick question: We are thinking to increase the Auth Cookie lifetime to 14 days instead of 1 as default. Is that something you would advise against security wise? Why do we need to do this? When a user comes back to our…

---

## [Connect Node.js to Multiple SAML IdP](https://community.auth0.com/t/connect-node-js-to-multiple-saml-idp/86528)

<div class="topic-metadata">

**Author:** [@ansnoussi](https://community.auth0.com/u/ansnoussi)\
**Replies:** 1\
**Last updated:** [May 20, 2024, 11:52am UTC](https://community.auth0.com/t/connect-node-js-to-multiple-saml-idp/86528 "2024-05-20T11:52:41Z")

</div>

Hi Everyone, I have a simple MERN app that currently doesn’t use Auth0, but instead I’m using a basic jwt authentication. I want to make it possible for users to use SSO with an IdP that they specify. (make it possibl…

---

## [How to use express-oauth2-jwt-bearer with Apollo-server and graphql?](https://community.auth0.com/t/how-to-use-express-oauth2-jwt-bearer-with-apollo-server-and-graphql/85966)

<div class="topic-metadata">

**Author:** [@marclovesjazz](https://community.auth0.com/u/marclovesjazz)\
**Replies:** 2\
**Last updated:** [July 1, 2022, 9:24am UTC](https://community.auth0.com/t/how-to-use-express-oauth2-jwt-bearer-with-apollo-server-and-graphql/85966 "2022-07-01T09:24:33Z")

</div>

Hi, I want to secure my API server (nodejs/apollo-server-express 3.x/graphql) and tried to use the recently published express-oauth2-jwt-bearer SDK from Auth0. Authentication seems to be working fine but when it comes …

---

## [What is the Swift equivilent of getAccessTokenSilently](https://community.auth0.com/t/what-is-the-swift-equivilent-of-getaccesstokensilently/85626)

<div class="topic-metadata">

**Author:** [@jgleason](https://community.auth0.com/u/jgleason)\
**Replies:** 2\
**Last updated:** [June 27, 2022, 2:57pm UTC](https://community.auth0.com/t/what-is-the-swift-equivilent-of-getaccesstokensilently/85626 "2022-06-27T14:57:14Z")

</div>

I am currently authorizing specific APIs on my browser based application using getAccessTokenSilently from @auth0/auth0-vue. I don’t see any similar option for the Swift library. Is there a similar concept? How do I get …

---

## [Unable to get user email id after authentication](https://community.auth0.com/t/unable-to-get-user-email-id-after-authentication/81134)

<div class="topic-metadata">

**Author:** [@ShubhamMetkar](https://community.auth0.com/u/ShubhamMetkar)\
**Replies:** 6\
**Last updated:** [April 8, 2022, 3:37pm UTC](https://community.auth0.com/t/unable-to-get-user-email-id-after-authentication/81134 "2022-04-08T15:37:22Z")

</div>

I’m following this article , repo and things are great so far until I was trying to get user’s email ID. I tried adding “email” scope in the auth-service.js file & tried to retrieve this email id same way username & prof…

---

## [Node module memory leak?](https://community.auth0.com/t/node-module-memory-leak/76943)

<div class="topic-metadata">

**Author:** [@ken2](https://community.auth0.com/u/ken2)\
**Replies:** 6\
**Last updated:** [January 26, 2022, 3:33pm UTC](https://community.auth0.com/t/node-module-memory-leak/76943 "2022-01-26T15:33:25Z")

</div>

We’ve been on the auth0 node module v2.18 for a few years, so we just went to update to 2.37. Once we update the module, our node server is leaking memory with each request. Is anyone else seeing this? I’ve tried updati…

---

## [Node-auth0: safe to use singleton ManagementClient?](https://community.auth0.com/t/node-auth0-safe-to-use-singleton-managementclient/76855)

<div class="topic-metadata">

**Author:** [@ken2](https://community.auth0.com/u/ken2)\
**Replies:** 2\
**Last updated:** [January 25, 2022, 1:45am UTC](https://community.auth0.com/t/node-auth0-safe-to-use-singleton-managementclient/76855 "2022-01-25T01:45:17Z")

</div>

In auth0-node, used in an express web-server, is it safe to make a single ManagementClient (Non Interactive Client ), and then keep that around in a global variable, or should we be creating a new ManagementClient object…

---

## [REST Architecture - Part 1: Building The API](https://community.auth0.com/t/rest-architecture-part-1-building-the-api/30669)

<div class="topic-metadata">

**Author:** [@ramiro](https://community.auth0.com/u/ramiro)\
**Replies:** 5\
**Last updated:** [March 2, 2021, 10:17am UTC](https://community.auth0.com/t/rest-architecture-part-1-building-the-api/30669 "2021-03-02T10:17:26Z")

</div>

Learn how to build client-server systems by applying the REST architecture principles. Part 1 shows how to build a true RESTful API by using Node.js and Express.js. Read on :hammer\_and\_wrench: Brought to you by @andrea…

---

## [Access\_token is malformed jwt when authenticating with google-oauth2](https://community.auth0.com/t/access-token-is-malformed-jwt-when-authenticating-with-google-oauth2/74218)

<div class="topic-metadata">

**Author:** [@mattymillar](https://community.auth0.com/u/mattymillar)\
**Replies:** 6\
**Last updated:** [December 6, 2021, 5:24pm UTC](https://community.auth0.com/t/access-token-is-malformed-jwt-when-authenticating-with-google-oauth2/74218 "2021-12-06T17:24:09Z")

</div>

I have a web application and I authenticate with google. I get a code back and I exchange it for a token by POST to /oauth/token. I get a successful token response, but when I try decode the access\_token inside I get “…

---

## [Oauth0 sdk (or examples) for nodejs v0.12](https://community.auth0.com/t/oauth0-sdk-or-examples-for-nodejs-v0-12/71492)

<div class="topic-metadata">

**Author:** [@ericsantos](https://community.auth0.com/u/ericsantos)\
**Replies:** 1\
**Last updated:** [October 18, 2021, 12:14pm UTC](https://community.auth0.com/t/oauth0-sdk-or-examples-for-nodejs-v0-12/71492 "2021-10-18T12:14:48Z")

</div>

Hello Community, I have a REST API implemented in NodeJS v0.12 and Express 4 and I have a demand to allow users from an organization (an enterprise client) to connect to it (through my website) with single sign-on using…

---

## [Get AccessToken to authorize API](https://community.auth0.com/t/get-accesstoken-to-authorize-api/70426)

<div class="topic-metadata">

**Author:** [@camediaonline](https://community.auth0.com/u/camediaonline)\
**Replies:** 4\
**Last updated:** [September 30, 2021, 6:26pm UTC](https://community.auth0.com/t/get-accesstoken-to-authorize-api/70426 "2021-09-30T18:26:06Z")

</div>

Hi there, I have just started with Auth0, got through some videos read the docs and made an small local nodejs client app (localhost:3000) that could authenticate using the forms from Auth0. Then i took a look howto pr…

---

## [User tokens now have null scope?](https://community.auth0.com/t/user-tokens-now-have-null-scope/67946)

<div class="topic-metadata">

**Author:** [@cwinters](https://community.auth0.com/u/cwinters)\
**Replies:** 3\
**Last updated:** [August 18, 2021, 8:13pm UTC](https://community.auth0.com/t/user-tokens-now-have-null-scope/67946 "2021-08-18T20:13:05Z")

</div>

I used to be able to retrieve a user’s token with its scope and validate it in my Express app. I would get the token like this: http POST https://inclusivecareco.us.auth0.com/oauth/token \< getUserToken.json this is the…

---

## [Where should I create ManagementClient instances...or should I just create users via client? (Node / React)](https://community.auth0.com/t/where-should-i-create-managementclient-instances-or-should-i-just-create-users-via-client-node-react/66746)

<div class="topic-metadata">

**Author:** [@czbaker](https://community.auth0.com/u/czbaker)\
**Replies:** 3\
**Last updated:** [July 29, 2021, 3:15pm UTC](https://community.auth0.com/t/where-should-i-create-managementclient-instances-or-should-i-just-create-users-via-client-node-react/66746 "2021-07-29T15:15:19Z")

</div>

I’m working on my first real project using Auth0 as an identity management solution and have run into a bit of a question: I see that when you use the NodeJS library (auth0) that you’re supposed to create an instance of…

---

## [Invalid Token: \`state\` does not match when redirecting to /authorize](https://community.auth0.com/t/invalid-token-state-does-not-match-when-redirecting-to-authorize/65138)

<div class="topic-metadata">

**Author:** [@reuvenk](https://community.auth0.com/u/reuvenk)\
**Replies:** 3\
**Last updated:** [June 29, 2021, 4:18pm UTC](https://community.auth0.com/t/invalid-token-state-does-not-match-when-redirecting-to-authorize/65138 "2021-06-29T16:18:28Z")

</div>

Hi, I have a webapp (react/node) using auth0. The auth is started using WebAuth.authorize and validated on return using WebAuth.parseHash. Everything works fine. My problem is that I need to create another flow in a d…

---

## [A Typical SaaS Application](https://community.auth0.com/t/a-typical-saas-application/60722)

<div class="topic-metadata">

**Author:** [@rubenhak](https://community.auth0.com/u/rubenhak)\
**Replies:** 3\
**Last updated:** [April 9, 2021, 12:49pm UTC](https://community.auth0.com/t/a-typical-saas-application/60722 "2021-04-09T12:49:56Z")

</div>

Hey Folks, I’m working on a typical SaaS application. There is a user facing page: https://portal.example.com and in internal page for admins: https://admin.example.com. Backend is node.js application. The same backend …

---

## [Specifying scope before calling loginWithRedirect()](https://community.auth0.com/t/specifying-scope-before-calling-loginwithredirect/58521)

<div class="topic-metadata">

**Author:** [@nwardcc](https://community.auth0.com/u/nwardcc)\
**Replies:** 6\
**Last updated:** [March 1, 2021, 9:03pm UTC](https://community.auth0.com/t/specifying-scope-before-calling-loginwithredirect/58521 "2021-03-01T21:03:54Z")

</div>

I have written a SPA using node react with a view to handling our client data within auth0. The app is working however to allow access to the metadata I am currently calling getAccessTokenSilently() with the scope set t…

---

## [Can't make post request](https://community.auth0.com/t/cant-make-post-request/57815)

<div class="topic-metadata">

**Author:** [@andrescg10](https://community.auth0.com/u/andrescg10)\
**Replies:** 3\
**Last updated:** [February 15, 2021, 9:24am UTC](https://community.auth0.com/t/cant-make-post-request/57815 "2021-02-15T09:24:15Z")

</div>

SDK: auth0-node Hello I’m setting up the auth with React in the front and Node on back, everything works fine when I try to make a GET to Node sending the token from an axios.get headers and checking it on the back but …

---

## [Serialize user\_metadata in req.user object](https://community.auth0.com/t/serialize-user-metadata-in-req-user-object/55362)

<div class="topic-metadata">

**Author:** [@mshenton75](https://community.auth0.com/u/mshenton75)\
**Replies:** 1\
**Last updated:** [December 29, 2020, 7:59pm UTC](https://community.auth0.com/t/serialize-user-metadata-in-req-user-object/55362 "2020-12-29T19:59:02Z")

</div>

I am using auth0 in my express app. Each user has some attributes in user\_metadata (I can see it in the user profile on the Auth0 UI), but there is no user\_metadata key on the req.user object in express. How can I get …

---

## [How do quickstarts for Angular client and Node.js API fit together?](https://community.auth0.com/t/how-do-quickstarts-for-angular-client-and-node-js-api-fit-together/50094)

<div class="topic-metadata">

**Author:** [@admin44](https://community.auth0.com/u/admin44)\
**Replies:** 2\
**Last updated:** [September 21, 2020, 4:16pm UTC](https://community.auth0.com/t/how-do-quickstarts-for-angular-client-and-node-js-api-fit-together/50094 "2020-09-21T16:16:32Z")

</div>

Hi, I’m trying to secure an Angular application I made as well as the respective backend API written in Node.js/Express.js. I have implemented auth0-angular according to the quickstart and want to use the included HTTP…

---

## [Alternative HTTP Module to Replace Deprecated Request](https://community.auth0.com/t/alternative-http-module-to-replace-deprecated-request/43028)

<div class="topic-metadata">

**Author:** [@brian.hyder](https://community.auth0.com/u/brian.hyder)\
**Replies:** 2\
**Last updated:** [May 18, 2020, 12:49pm UTC](https://community.auth0.com/t/alternative-http-module-to-replace-deprecated-request/43028 "2020-05-18T12:49:14Z")

</div>

The request module is now deprecated. It appears to be the only HTTP convenience package available for rules and hooks: https://auth0.com/docs/appliance/modules Does anyone know if Auth0 plans to replace it with an alt…

---

## [Auth0.getProfile gives back undefined (Node.js and Firebase)](https://community.auth0.com/t/auth0-getprofile-gives-back-undefined-node-js-and-firebase/42330)

<div class="topic-metadata">

**Author:** [@sanderisbestok](https://community.auth0.com/u/sanderisbestok)\
**Replies:** 4\
**Last updated:** [May 5, 2020, 8:55am UTC](https://community.auth0.com/t/auth0-getprofile-gives-back-undefined-node-js-and-firebase/42330 "2020-05-05T08:55:56Z")

</div>

Hi all, I am trying to implement (for the first time) Auth0 for my Google Action. I used this tutorial and most of it seems to be working. However when I execute the code and check the logs I don’t get anything back fro…

---

## [Verifying at\_hash on rs256 id token without access token](https://community.auth0.com/t/verifying-at-hash-on-rs256-id-token-without-access-token/39551)

<div class="topic-metadata">

**Author:** [@ApartmentTherapy](https://community.auth0.com/u/ApartmentTherapy)\
**Replies:** 0\
**Last updated:** [March 17, 2020, 7:51pm UTC](https://community.auth0.com/t/verifying-at-hash-on-rs256-id-token-without-access-token/39551 "2020-03-17T19:51:56Z")

</div>

Hi, I saw a couple of other similar questions to mine in the community db but no answers. Hoping someone can shed some light. I have a client app that’s using the node js library to authenticate a user. It receives and …

---

## [How do I secure Azure App Service end-point for MobileServiceClient in Xamarin Forms?](https://community.auth0.com/t/how-do-i-secure-azure-app-service-end-point-for-mobileserviceclient-in-xamarin-forms/38309)

<div class="topic-metadata">

**Author:** [@lindsaymiles](https://community.auth0.com/u/lindsaymiles)\
**Replies:** 3\
**Last updated:** [February 24, 2020, 9:59pm UTC](https://community.auth0.com/t/how-do-i-secure-azure-app-service-end-point-for-mobileserviceclient-in-xamarin-forms/38309 "2020-02-24T21:59:52Z")

</div>

Hello, Not entirely an Auth0 issue but hoping someone can help! I have an app that uses Auth0 as the login provider and can login through multiple providers - Facebook, LinkedIn, Google, MS and Apple. This all happens …

---

## [What Auth0 set up is best for React front end and Node.js back end?](https://community.auth0.com/t/what-auth0-set-up-is-best-for-react-front-end-and-node-js-back-end/14743)

<div class="topic-metadata">

**Author:** [@johnjmac49](https://community.auth0.com/u/johnjmac49)\
**Replies:** 1\
**Last updated:** [September 11, 2018, 1:52pm UTC](https://community.auth0.com/t/what-auth0-set-up-is-best-for-react-front-end-and-node-js-back-end/14743 "2018-09-11T13:52:24Z")

</div>

I am just wondering , what is the best auth0 set up for a React front end that will be running on separate server to the node.js back end using express and Apollo GraphQL. Jay

---

## [NodeJS - Execute an authorization grant](https://community.auth0.com/t/nodejs-execute-an-authorization-grant/11978)

<div class="topic-metadata">

**Author:** [@to.charlie.nash](https://community.auth0.com/u/to.charlie.nash)\
**Replies:** 4\
**Last updated:** [May 30, 2018, 8:56pm UTC](https://community.auth0.com/t/nodejs-execute-an-authorization-grant/11978 "2018-05-30T20:56:32Z")

</div>

Question: I the doc, section titled “Execute an authorization grant flow”, the first step is to get the User’s Authorization. The doc, states “To begin an Authorization Code flow, your web application should first send…

[Next page](https://community.auth0.com/tag/nodejs/127.md?match_all_tags=true&page=1&tags%5B%5D=nodejs)
