getting "Status Code: 401 Unauthorized" from /hello
See original GitHub issueIssue
getting “Status Code: 401 Unauthorized” from /hello in Chrome In the API console, i see:
{"name":"AzureAD: Bearer Strategy","hostname":"US-LT-10272","pid":1
5812,"level":30,"msg":"authentication failed due to: token is not found","time":"2022-08-23T23:57:02.462Z","v":0}
GET /hello 401 1.355 ms - -
I do see right before /hello is called, i see /token is called and it does return a token like:
{
"id_token": "eyJ0eX....",
"token_type": "Bearer",
"not_before": 1661293983,
"client_info": "eyJ1aW...",
"scope": "",
"refresh_token": "eyJraW...",
"refresh_token_expires_in": 86400
}
So why isn’t it passing it along to /hello?
like /hello has a authorization token like so: authorization: Bearer and im guessing it should have a value like: authorization: Bearer eyJ0eX
Believe I setup everything according to spec in the Azure AD B2C settings for the App/Registration/UserFlows, and configured the config.js and authConfig.js with the simple updates mentioned in the tutorial as well.
Please provide us with the following information:
This issue is for the sample
- [ ] 1-1) Sign-in with Azure AD
- [ ] 1-2) Sign-in with Azure AD B2C
- [ ] 2-1) Acquire a Token and call Microsoft Graph
- [ ] 3-1) Protect and call a web API on Azure AD
- [x] 3-2) Protect and call a web API on Azure AD B2C
- [ ] 4-1) Deploy to Azure Storage and App Service
- [ ] 4-2) Deploy to Azure Static App Service
- [ ] 5-1) Call a web API using App Roles
- [ ] 5-2) Call a web API using Security Groups
- [ ] 6-1) Call Microsoft Graph using on-behalf-of flow
- [ ] 6-2) Call a web API using Proof of Possession tokens
- [ ] 6-3) Call a web API using Conditional Access Auth Context
This issue is for a
- [x] bug report -> please search issues before submitting
- [ ] question
- [ ] feature request
- [ ] documentation issue or request
Minimal steps to reproduce
Any log messages given by the failure
Request URL: http://localhost:5000/hello, Request Method: GET, Status Code: 401 Unauthorized
Expected/desired behavior
Request URL: http://localhost:5000/hello, Request Method: GET, Status Code: 200
Browser and version
Chrome 104.0.5112.81 (Official Build) (32-bit) Node v14.18.0
Thanks! We’ll be in touch soon.
Issue Analytics
- State:
- Created a year ago
- Comments:10 (5 by maintainers)
Top GitHub Comments
@armyofda12mnkeys No worries, I am happy to help. The colors are randomly generated if you do not upload a logo image for the app.
If I may ask a side question before closing the ticket. Now that my app ‘works’, should it turn green on the main registration listing page: Thought it was kinda weird its just grey (some inactive status?) and other apps there are green (active status?).