JWT Authentication Support does not work
See original GitHub issueQ | A |
---|---|
Issue Type | Issue |
Admin Version | v0.6.3 |
Solution | Downgrade to v0.6.2 |
Local Machine OS | Ubuntu 18.04 (but shouldn’t be relevant in this case) |
Description
Hello!
I have detected a problem with version 0.6.3 related to JWT Authentication.
When you login correctly and the process of loading all entities is done to map the fields, the Authorization: Bearer [token] header is not sent and generates an error 401 Invalid JWT Token.
Failed to load resource: the server responded to a status of 401
In other calls if it is sent, for example, in the call Request Method: OPTIONS.
I validated the JWT token in https://jwt.io/ in case there was an error, but it is a valid token. I used token in Swagger and it has worked correctly.
The solution I have found is to downgrade to v0.6.2.
package.json file
{
"name": "admin-component",
"version": "0.1.0",
"private": true,
"dependencies": {
"@api-platform/admin": "0.6.3",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-scripts": "3.0.1"
},
"devDependencies": {
"dotenv-cli": "^2.0.0"
},
"scripts": {
"start": "react-scripts start",
"build:pro": "react-scripts build",
"build:dev": "dotenv -e .env.development.local react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
If you need more information, ask me.
Grettings @jjpeleato.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:16 (3 by maintainers)
Top Results From Across the Web
Troubleshooting JWT validation - Google Cloud
Troubleshooting JWT validation · Make sure the JWT contains valid JSON. · Check that the JWT header has the "alg" field and is...
Read more >Troubleshooting JWT authentication - RingCentral Developers
A JWT is not itself a way to authenticate to the API. Instead, JWT credentials are used to create access tokens. Only access...
Read more >Troubleshooting issues with HTTP API JWT authorizers
The following provides troubleshooting advice for errors and issues that you might encounter when using JSON Web Token (JWT) authorizers with HTTP APIs....
Read more >JWT Authentication not working when trying to access a page ...
JWT Authentication not working when trying to access a page directly with valid token; will work when starting at login. React/Node/Express.
Read more >JWT authentication: Best practices and when to use it
JSON Web Tokens (JWT) is a JSON-encoded representation of a claim or claims that can be transferred between two parties. Though it's a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FYI, we’re working with @marmelab on a brand new version of API Platform Admin. It is almost ready, and will improve a lot the authentication part.
Guys! please test again with version 1.0.1
A few notes: