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

Support OAuth2 (client credentials flow) for Action Handlers #9265

Open
radicand opened this issue Dec 2, 2022 · 2 comments
Open

Support OAuth2 (client credentials flow) for Action Handlers #9265

radicand opened this issue Dec 2, 2022 · 2 comments
Labels
k/enhancement New feature or improve an existing feature t/gql-services

Comments

@radicand
Copy link

radicand commented Dec 2, 2022

Is your proposal related to a problem?

I have a number of cases where I'd like to use Actions to expose data and mutations from backend APIs that are secured with OAuth2 (client credentials flow). In order to make this work today, I need to write middleware services that essentially handle the OAuth handshake and proxy. This creates a hard to maintain sprawl of proxy services and tech debt.

Describe the solution you'd like

I could simplify the tech debt if Hasura could handle these backends secured by OAuth2 on its own. Today you can use request headers if your backend supports a header-based API key or a static Authorization header. It would be helpful to have Hasura accept a token endpoint, client ID, client secret, and scope variables and handle requesting the token (caching it / handling expiration), and using this when making a request to the backend REST API.

This would allow us to simplify our stack significantly and reduce tech debt.

Describe alternatives you've considered

The only other alternative I'm aware of is what we're already doing, which is to write a proxy that handles the OAuth handshake and proxies the data flow.

@radicand radicand added the k/enhancement New feature or improve an existing feature label Dec 2, 2022
@rahulagarwal13
Copy link
Contributor

Hey @radicand - Thank you for submitting this feature request. We agree that this could help in simplifying your implementation and this is something we will consider on our roadmap. We do not have a timeline at present to provide you. Please continue to follow this Github issue to get notified of any update on this.

Would be curious to know if you are also using or interested in any of the other OAuth2 flows apart from client credentials?

@radicand
Copy link
Author

Would be curious to know if you are also using or interested in any of the other OAuth2 flows apart from client credentials?

Not at this time, as a server to server backend flow, client_credentials really makes the most sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
k/enhancement New feature or improve an existing feature t/gql-services
Projects
None yet
Development

No branches or pull requests

3 participants