Skip to content

Using Wundergraph /w existing oAuth tokens and server-side? #422

Answered by jensneuse
t1mmen asked this question in Q&A
Discussion options

You must be logged in to vote

Is this a good use case for WunderGraph? Yes, absolutely! Merging APIs, unifying them, federated auth, absolutely!

How to solve 2/3?

Step 1, configure dynamic origin headers, like this example: https://docs.wundergraph.com/docs/wundergraph-config-ts-reference/configure-headers-for-http-based-data-sources#dynamic-headers

E.g. if your origin named foods the Authorization header, you can forward the client request header "X-Foo-Authorization" as Authorization header.

If you're calling this from a backend, you already have access to the access token I guess, so you can set the header yourself.

If you're calling it from a frontend client, you can use a pre resolve hook to set the header. The h…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by t1mmen
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants