I’m just trying to follow follow the “choose your own stack” tutorial for React and Express, and I can’t get it working correctly.
Behavior:
- When I go to my https://localhost:4040 url, it shows a spinner for 60+ seconds before showing me the page. In the console it reads:
Failed to load resource: the server responded with a status of 400 () … domain_name.us.auth0.com/authorize?client_id=clientID&scope=openid+profile+email&redirect_uri=http%3A%2F%2Flocalhost%3A4040%2Fcallback&prompt=none&response_type=code&response_mode=web_message&state=blphajVNSEVHWFBsV25sdW5SV3JLcm5sb25rbkpnTU5rSzd0MVFOcmZyLg%3D%3D&nonce=MS53OWlzOWxudURMVmk5TzZraGd6TEMwa2N6NGVSLUJwVDA0QXBjT1VPbg%3D%3D&code_challenge=IDREMqzy4of-qH43lSkro4UAeLRlHbhuS-2hq3S1mdo&code_challenge_method=S256&auth0Client=eyJuYW1lIjoiYXV0aDAtcmVhY3QiLCJ2ZXJzaW9uIjoiMi4wLjAifQ%3D%3D:1
From the network:Headers panel
https://domain_name.us.auth0.com/authorize?client_id=tanvglrxgePkncAMgDdFY9Zw47TdEAPq&scope=openid+profile+email&redirect_uri=http%3A%2F%2Flocalhost%3A4040%2Fcallback&prompt=none&response_type=code&response_mode=web_message&state=ZWRmVkN4M3RJaGg1d21EYzNVT3dCcEt0VVcuLlBRc1VfYzhab3RTRXVqMQ%3D%3D&nonce=OTlXd0YtZjNXSjFBRjR0YjliYjJrNm9MYWdsdDllV212R1BZMDZrMGdTNA%3D%3D&code_challenge=T_vhFifnthyny8u9SFbmuLZbuL5v7TnS018qZ7WnQLA&code_challenge_method=S256&auth0Client=eyJuYW1lIjoiYXV0aDAtcmVhY3QiLCJ2ZXJzaW9uIjoiMi4wLjAifQ%3D%3D
Request Method:
GET
Status Code:
400 Bad Request
Remote Address:
104.19.167.24:443
Referrer Policy:
strict-origin-when-cross-origin
-
After it finally loads, I click “Login” and it brings me to the generic signup/login page. I log in and get to the profile page, which looks correct.
-
When I click on “Protected” or “Admin” in the nav bar, the message shows:
{
“message”: “Requires authentication”
}
I assume that I am misconfiguring somehow. Here’s me FE .env file…
REACT_APP_AUTH0_DOMAIN=Auth0Domain
REACT_APP_AUTH0_CLIENT_ID=ClientID
REACT_APP_AUTH0_CALLBACK_URL=http://localhost:4040/callback
REACT_APP_AUTH0_AUDIENCE=https://hello-world.example.com
REACT_APP_API_SERVER_URL=http://localhost:6060
The tutorial on the site DOES NOT HAVE AN EXAMPLE ENV FILE. So I have no idea if this is right or if I got it totally wrong. It also does not have a troubleshooting section.
Can anyone help me? Thank you in advance!