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

GraphQL typesafe client - support for @OidcClientFilter #35878

Closed
rmanig opened this issue Sep 12, 2023 · 8 comments · Fixed by #36375
Closed

GraphQL typesafe client - support for @OidcClientFilter #35878

rmanig opened this issue Sep 12, 2023 · 8 comments · Fixed by #36375

Comments

@rmanig
Copy link

rmanig commented Sep 12, 2023

Description

Hi there!
I would like to use the graphql typesafe client in combination with oidc tokens. The current static options to set and use an (authorization) header seem to be too limited for the temporary short-lived access tokens.

Are there any plans to support the io.quarkus.oidc.client.filter.OidcClientFilter for example? Which would handle token refreshing as well.

@GraphQLClientApi (configKey = "foo")
@OidcClientFilter ("foo")
public interface FooApi {
   //...
}

Thanks in advance!

Implementation ideas

No response

@quarkus-bot
Copy link

quarkus-bot bot commented Sep 12, 2023

/cc @jmartisk (graphql), @pedroigor (oidc), @phillip-kruger (graphql), @sberyozkin (oidc)

@sberyozkin
Copy link
Member

Hi @rmanig

Current OidcClientFilter is HTTP centric, I believe there should be a Quarkus GraphQL specific interceptor which will do the same what what OIDC Client Reactive filter does here - just extend the core OIDC client code but set the token using GraphQL mechanism, except that in case of GraphQL it will be a concrete class. A non-reactive version can be created. I can help Jan or yourself to clarify the details if such an option will be implemented

@jmartisk
Copy link
Contributor

jmartisk commented Sep 13, 2023

I'll try to make some time for this soon and have a look.. I think we'll need a reactive as well as non-reactive variant, and create some way to pass headers into the GraphQL client config as an Uni. We don't use any interceptors per se in GraphQL clients

@sberyozkin
Copy link
Member

Hey Jan, you can probably limit it to the preferred reactive option

@jmartisk
Copy link
Contributor

Right, it will use the reactive client, but will block waiting for the token

@rmanig
Copy link
Author

rmanig commented Sep 13, 2023

Thanks for having a look! I would love to help, but I'm not really sure if I'm able to or where to start in the graphql-client.

@jmartisk
Copy link
Contributor

I'm assuming this will require a whole new extension, just like we have two extensions for the REST client filters... Unless we want to add the OIDC client as a direct dependency of the GraphQL client extension, which we probably don't.

@jmartisk
Copy link
Contributor

FYI I have a working prototype but it needs a lot of polishing, and tests, if it goes well I might have some PRs ready by the end of the week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants