-
Notifications
You must be signed in to change notification settings - Fork 0
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] cannot use authMode: oidc without Cognito user pool. #510
Comments
Hi @PG-practice, thank you opening the issue with a detailed description. I believe this belongs to Amplify Data, I will have someone transfer this over so they can best assist you. |
Hi @PG-practice 👋 thanks for raising this issue. It looks like you might be running into the same blocker as the OP of this other issue: Can you please try adding a prefix or suffix to the token as you pass it to Let us know if that helps! |
Thanks!
|
Hi @PG-practice Thank you for responding. Since this issue specifically mentions needing a Cognito User Pool for I will close this one out as a duplicate since it's more recent. Please track #507 for future updates as I try to reproduce the issue. |
Before opening, please confirm:
JavaScript Framework
Not applicable
Amplify APIs
GraphQL API
Amplify Version
v6
Amplify Categories
api
Backend
Other
Environment information
Describe the bug
When you want to use Amplify JavaScript just to request to Existing AppSync API with its Authentication mode 3rd party OIDC, the library now seems to require Amazon Cognito User pool.
The code below results in the error
NoValidAuthTokens: No federated jwt at headerBasedAuth ......
Cause:
Even when
authMode
is set to 'oidc', Amplify JavaScript still process it in the same way as authModeuserpool
Possible Solution:
Given the following:
Authorization
headerthe code here should start to request with Authorization header, and without requiring Cognito
before
after
Simply this change make it possible to send
authToken
parameter as Authorization header without any Cognito resource.If it's ok, I could PR the change, but I'm concerned that I've overlooked another way to request to existing AppSync API with external OIDC authentication mode. I cannot find it.
Related Documents:
No federated jwt
.authorizationModes
on AppSync API andauthMode
on client code, which implies that authMode 'oidc' isn't helpful.similar issue
#507
Expected behavior
For existing AppSync resources with OIDC authorization mode, we should only need to pass the Authorization header
Cognito resources should not be required
Possible Solution (Repost):
before
after
Reproduction steps
Gen 2 doesn't support front end code generation as of now, so this needs Amplify CLI. support generating GraphQL client code by pointing to an AppSync API ID amplify-backend#1903
npm install aws-amplify
authToken
parameterNo federated jwt
error.Code Snippet
App.js
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: