Issue with API


I try to generate a Jwt Token from a JS app in order to be able to reach one of my server.
Mainly I called :
and then
but the call back fails with a call to auth/token with a 401 error.
Here is my code:
const callSso = () => Auth0({ domain: ‘’, client_id: ‘7uvYO9Vtc1QxQQuSavv0Xin2vcY5h1ns’ });

const getJwtToken = async () => {
if(jwtPromise === undefined) {
jwtPromise = await callSso();
if (“code=”)) {
await jwtPromise.handleRedirectCallback(window.location.href);
window.history.replaceState(window.location.href, document.title, window.location.origin + window.location.pathname + window.location.hash);
const isAuth = await jwtPromise.isAuthenticated();
if(isAuth) {
return decodeToken(jwtPromise);
const retUrl = window.location.protocol + ‘//’ + + window.location.pathname;
await jwtPromise.loginWithRedirect({redirect_uri: retUrl, response_type:‘id_token token’, scope:‘name openid’});
// never return we have redirected
return new Promise((_sucess) => {});

I try to compile and run the react sample and it gives the exact same error.

1 Like

Hard to say what’s going wrong. Could you capture a HAR file and upload here? (Make sure you remove any confidential information from HAR file such as username & pwd before uploading here).

Also have you compared your implementation with one of the official quickstarts? Auth0


Here is the har file zipped : (3.2 MB)
It is also failing with the sample react project.



1 Like

@sku are you by any chance using Regular Web Application as your Application type? What is the Token Endpoint Authentication method for your app? It should be Single Page Application type and Token Endpoint Authentication Method should be set to None.