admin: JWT Authentication Support does not work

Q 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.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 16 (3 by maintainers)

Most upvoted 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:

it still doesn’t work in 1.0.0

Confirm!