Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigating using a JWT for Hasura authentication #1530

Open
dysbulic opened this issue Feb 18, 2023 · 3 comments
Open

Investigating using a JWT for Hasura authentication #1530

dysbulic opened this issue Feb 18, 2023 · 3 comments
Labels
backend Backend related issues feature request Feature Requests Hasura GraphQL / Hasura related tasks medium Medium Priority refactor Issues for opportunities to refactor parts of the codebase

Comments

@dysbulic
Copy link
Member

What would you like to be added?

Hasura has two modes for authenticating connections. Either it can connect to the backend on each connection and get permission, or the server can generate a JSON Web Token representing the user's role which is reused for each connection without any server interaction.

We are currently authenticating each connection, but the JWT would both be more performant and reliable.

Why is this needed?

I'm frequently (~20% of the time) getting the following error:

Screenshot from 2023-02-17 20-46-28

The process of an endpoint that is only generating a token would be a simpler interaction that is easier to debug and removed the need for repeated requests.

Additionally, adding another network request for every query can't be helping performance.

@dysbulic dysbulic added backend Backend related issues Hasura GraphQL / Hasura related tasks refactor Issues for opportunities to refactor parts of the codebase feature request Feature Requests medium Medium Priority labels Feb 18, 2023
@dysbulic dysbulic added this to MyMeta Feb 18, 2023
@github-project-automation github-project-automation bot moved this to Backburner in MyMeta Feb 18, 2023
@alalonde
Copy link
Contributor

I'm frequently (~20% of the time) getting the following error

This is almost always due to the backend not actually running.

Additionally, adding another network request for every query can't be helping performance.

This is only a network request from hasura to the backend, not from browser -> backend.

That all said, I have another project where we set up Hasura to use JWTs and it was fairly straightforward. Were I to do this, I would also upgrade Hasura to the latest version.

@Seroxdesign
Copy link
Contributor

Closing this, reopen if still relevant @dysbulic @alalonde

@github-project-automation github-project-automation bot moved this from Backburner to Done in MyMeta Oct 5, 2023
@dysbulic
Copy link
Member Author

dysbulic commented Oct 8, 2023

I think this is worth looking into. It would remove a network call needed for every Hasura interaction & network calls ain't cheap.

Especially since @alalonde said it's not all that hard to implement.

@dysbulic dysbulic reopened this Oct 8, 2023
@github-project-automation github-project-automation bot moved this from Done to In progress in MyMeta Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Backend related issues feature request Feature Requests Hasura GraphQL / Hasura related tasks medium Medium Priority refactor Issues for opportunities to refactor parts of the codebase
Projects
Status: In progress
Development

No branches or pull requests

3 participants