You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using this library to wrap to different APIs and combine them into a unified graphql interface using express-graphql. I have two different specs, spec1.json and spec2.json and I'm able to create a schema by passing both of these to createGraphqlSchema.
The problem is with authentication. spec1 uses OAuth and following the suggestion in #116 (comment) I have a separate express middleware that fetches the token and puts it in the request object. When calling createGraphqlSchema, I pass in the path to this using the tokenJSONPath option.
On the other hand, spec2 uses a simple static API token which also goes into the Authorization header and I set this using the headers option in createGraphqlSchema - first I check if the title matches spec2.info.title and then I override this header.
However this seems not to work since the tokenJSONPath always takes priority. Is there a way to work around this and essentially provide different authentication tokens to different specs?
The text was updated successfully, but these errors were encountered:
I'm using this library to wrap to different APIs and combine them into a unified graphql interface using express-graphql. I have two different specs,
spec1.json
andspec2.json
and I'm able to create a schema by passing both of these tocreateGraphqlSchema
.The problem is with authentication.
spec1
uses OAuth and following the suggestion in #116 (comment) I have a separate express middleware that fetches the token and puts it in therequest
object. When callingcreateGraphqlSchema
, I pass in the path to this using thetokenJSONPath
option.On the other hand,
spec2
uses a simple static API token which also goes into theAuthorization
header and I set this using theheaders
option increateGraphqlSchema
- first I check if the title matchesspec2.info.title
and then I override this header.However this seems not to work since the
tokenJSONPath
always takes priority. Is there a way to work around this and essentially provide different authentication tokens to different specs?The text was updated successfully, but these errors were encountered: