Passing a federated identity into AWSAppSyncClient?
See original GitHub issueHere’s what im trying to do essentially in React.
- User logs in via a login mutation with appsync and is returned an identityId and JWT token from the response.
const cognitoCredentials = new AWS.CognitoIdentityCredentials({
IdentityPoolId: 'IdentityPool goes here',
IdentityId: 'IdentityId here',
Logins: {
'cognito-identity.amazonaws.com': 'JWT Token here'
}
});
- I pass the credentials with the users identityId And JWT token to Appsync to authenticate them…
const client = new AWSAppSyncClient({
url: appSyncConfig.graphqlEndpoint,
region: appSyncConfig.region,
auth: {
type: AUTH_TYPE.AWS_IAM,
credentials: cognitoCredentials
}
});
My question is… is this the approach I should be taking or is there an easier way of doing this? I don’t want to use user pools because it will end up being too expensive for me; so i’m going the federated identity approach. I will create a user…and save them as a federated identity using their database user id.
Sorry if this is the wrong section, but maybe someone knows!
Issue Analytics
- State:
- Created 6 years ago
- Comments:7
Top Results From Across the Web
How to access AppSync API using custom Federated Identity
I'm trying to consume AWS AppSync API using Federated Identities with custom authenticated role but without success.
Read more >Authorization and authentication - AWS AppSync
Learn about authentication and authorization in AWS AppSync. ... using short-lived, temporary credentials provided by Amazon Cognito Federated Identities.
Read more >Authentication - GitHub Pages
To federate Google as a user sign-in provider for AWS services called in your app, you will pass tokens to AWSMobileClient.sharedInstance().federatedSignIn() .
Read more >Authentication - Federated identities - Swift - AWS Amplify Docs
Federated Sign In can be used to obtain federated “Identity ID” using external ... Once you pass the tokens, the AWSMobileClient will fetch...
Read more >AWS AppSync without Authentication - DEV Community
The first step is to specify the authentication type in aws-exports.js . ... '@aws-amplify/auth' import AWSAppSyncClient from 'aws-appsync' ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@lolcoolkat How do you get your custom headers from the client you lambdas. I am using IAM auth and lambdas and AppSync doesn’t seem to pass along headers (unless I am doing it wrong which is very possible).
Got it, apologies for any confusion!