Open adguernier opened 10 months ago
API Platform version(s) affected: 3.2.2 @api-platform/admin: 3.4.4
Description My context: I have a JWT protected API, and a protected Hydra-admin with a custom authProvider and the requireAuth set to true.
authProvider
requireAuth
<HydraAdmin requireAuth entrypoint={window.origin} dataProvider={dataProvider} authProvider={authProvider} />
The first time I go to my admin app (https://localhost/admin), I'm redirected to the login page (https://localhost/admin#/login). No problem here. I log in and I'm redirected to the welcome React-admin page instead of the resources view.
How to reproduce You can clone this repository https://github.com/adguernier/api-platform-auth-provider and follow the README.md
README.md
Possible Solution It seems the adminDataProvider introspect() method does not check the authProvider checkAuth() method.
adminDataProvider
introspect()
checkAuth()
Additional Context The first time the login page is render, an error occurred in the console:
The dataProvider I've written uses the Bearer token as described in your example
dataProvider
Bearer token
An example is worth a thousand words
https://github.com/api-platform/admin/assets/7949510/153e9e78-4632-4712-80c5-540d5bdd3331
@adguernier is it still a problem in API Platform admin v4?
API Platform version(s) affected: 3.2.2 @api-platform/admin: 3.4.4
Description
My context: I have a JWT protected API, and a protected Hydra-admin with a custom
authProvider
and therequireAuth
set to true.The first time I go to my admin app (https://localhost/admin), I'm redirected to the login page (https://localhost/admin#/login). No problem here. I log in and I'm redirected to the welcome React-admin page instead of the resources view.
How to reproduce
You can clone this repository https://github.com/adguernier/api-platform-auth-provider and follow the
README.md
Possible Solution
It seems the
adminDataProvider
introspect()
method does not check theauthProvider
checkAuth()
method.Additional Context![image](https://github.com/api-platform/admin/assets/7949510/71e23af6-83f1-4d5b-b42f-851ba9488916)
The first time the login page is render, an error occurred in the console:
The
dataProvider
I've written uses theBearer token
as described in your exampleAn example is worth a thousand words
https://github.com/api-platform/admin/assets/7949510/153e9e78-4632-4712-80c5-540d5bdd3331