Neo4j Graphql throwing unauthenticated error

Hi.
I used the auth directive in Neo4j Graphql, but it's throwing "Unauthenticated" error even when the "authorization" header is set with a valid JWT. Why is this happening?

Did you verify your Token with a "Secret"? You must decode the header and verify your Token with a secret. Usually, this secret is provided to you by the authentication service provider like (Firebase, AWS...).

What authentication provider are you using ??

Am assigning token myself using jsonwebtoken with a secret in the environment variables. But it working now. I included 'Bearer' in the authorization header, so everything is good. Thank you.

1 Like

I have used the latest updated Neo4jGraphQLAuthentication and using my secret key too when i am passing with Authorization header and along with Bearer passing the token which is verified from jwt.io but it returns Neo4jGraphQLAuthenticationError: Unauthenticated.

{
** "authorization":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJ1c2VySWQiOiIxMDAiLCJvcmdJZCI6ImRlZmF1bHRfc3RvcmUiLCJwZXJtaXNzaW9ucyI6WyJyZWFkOml0ZW1zIl19.YRsBITZhIeHuiqenG97oWT_paHj4bo78yMxuOH5Zm0g"**
}