hasura / ra-data-hasura

react-admin data provider for Hasura GraphQL Engine
MIT License
336 stars 70 forks source link

Improve the Authentication Headers example to avoid security flaws #147

Open slax57 opened 1 year ago

slax57 commented 1 year ago

It seems to me that the Adding Authentication Headers section is very misleading in the way it suggests to implement authentication.

It encourages to pass the hasura admin secret as the x-hasura-admin-secret http header, but this should be kept for early developing stages only. If ever such code gets deployed to production, then basically the hasura admin secret will be embedded in the (client-side) JS code, as well as each HTTP requests.

To me, this doc section should rather encourage providing only the JWT token, or add least add a very highlighted warning note about it.