[GraphQL] cannot use authMode: oidc without Cognito user pool. #14166
Labels
pending-maintainer-response
Issue is pending a response from the Amplify team.
pending-triage
Issue is pending triage
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
aws-amplify/amplify-data#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: