Questions tagged [aws-amplify-sdk-js]

Use this tag to group queries related to AWS Amplify that are related to the JavaScript SDK as opposed to the Amplify CLI or the iOS / Android libraries.

The Amplify framework has several products, including:

  • Amplify CLI (open source)
  • Amplify SDK for JS (open source)
  • Amplify React, Angular, and Vue component libraries
  • Amplify SDKs for iOS / Android (open source)
  • Amplify Console (managed, paid service)

This tag can be used to group queries just related to the second bullet.

87 questions
1
vote
1 answer

Amplify gives "No current user" only in Safari?

Context: I'm using Amplify for authentication in a static site that is composed of 2 sites frankensteined together by building Website A, putting it into an S3 bucket and the building website B and placing its build files within a subfolder of that…
Techie
  • 11
  • 3
1
vote
0 answers

Working with AWS Amplify and Securing GraphQL API Calls

const client = new AWSAppSyncClient({ url: AWSConfig.aws_appsync_graphqlEndpoint, region: AWSConfig.aws_appsync_region, auth: { type: AWSConfig.aws_appsync_authenticationType, jwtToken: () => req.headers.authorization, }, …
Aaron Saunders
  • 33,180
  • 5
  • 60
  • 80
1
vote
1 answer

Separating user pools for JavaScript AWS Amplify SDK / AWS Cognito based authentication in React app

I have a React-native web application working with the authentication completely based on a user pool managed by AWS Cognito. All the authentication-related screens (login, registration, change password) are managed by AWS Amplify JavaScript SDK.…
1
vote
0 answers

Amplify API REST with AWS_IAM: Request failed with status code 403

I'm trying to execute API calls from ReactNative AWS Amplify to API Gateway endpoint using AWS_IAM authorization. I do it by calling (all Amplify initialization params are set): import { API, Auth } from "aws-amplify"; ... API.get("MyApiName",…
1
vote
1 answer

cognito custom auth (CUSTOM_CHALLENGE) ignore retry because session expiration

my goal is to implement otp by sending a sms to user mobile. im able to achieve this using cognito custom auth flow, but, only works if the user success in the firts attemp, if the user enter a bad code, the session is gonna expire and a new code is…
adrian oviedo
  • 684
  • 1
  • 8
  • 27
1
vote
1 answer

Use Amplify to generate Credentials from Auth.currentCredentials() after Auth.currentSession()

I am trying to run const credentials = await Auth.currentCredentials() const creds = await Auth.essentialCredentials(credentials) AWS.config.credentials = new AWS.Credentials(creds.accessKeyId, creds.secretAccessKey, creds.sessionToken) But first…
belostoky
  • 934
  • 2
  • 11
  • 22
1
vote
1 answer

AWS Amplify Datastore AppSync not synchronize IndexDB with DynamoDB

I followed this tutorial. It worked just fine before I updated aws-amplify to v3.3.26. After the update it stopped to synchronize IndexDB with DynamoDB. I didn't have any errors when I set Amplify.Logger.LOG_LEVEL = 'DEBUG'. After tutorial in…
1
vote
0 answers

AuthorizationHeaderMalformed Error when upload a file on S3 using Amplify

I had this part of code to send a file to S3 using Amplify const file = e.target.files[0]; try { console.log(Storage.vault) await Storage.put(file.name, file); } catch (error) { …
1
vote
0 answers

Recognize user who has signed up with Google but tries to sign in with email in AWS Cognito

I'm using AWS Cognito Federated Identities to enable social login with Google in a web app. Attempts: User (with email foo@gmail.com) signin/signup by Google User login by email foo@gmail.com Normal behavior: In the 2nd attempt, user will get an…
1
vote
0 answers

How to configure OIDC token authentication (I am using firebase) using aws-amplify library?

I am using aws-amplify javascript library for query, mutations etc on AWS Appsync API. I am using OpenId Connect as the default authorization mode and have configured Firebase as the IdentityProvider (IdP). So, basically I want to add the…
1
vote
1 answer

What is the equivalent for Auth.updateUserAttributes in amplify_auth_cognito

Link 1. What is the equivalent for const user = await Auth.currentAuthenticatedUser(); const result = await Auth.updateUserAttributes(user, { 'custom:favorite_flavor': 'Strawberry' }); in Flutter amplify_core: '<1.0.0' amplify_auth_cognito:…
1
vote
2 answers

How can I get my dynamodb lambda function to check the user's identity?

I've set up a dynamodb lambda trigger using this documentation. The function successfully triggers when the dynamodb table is updated, and I can view the output just fine. I want to find the identity of the user that updated the dynamodb table but…
1
vote
1 answer

How to mock AWS amplify methods in Angular unit testing

I am using AWS cognito, Amplify and Angular 10. I want a navbar not to be rendered if a user is not logged in: app.html: app.ts: constructor() { …
1
vote
0 answers

How to conditionally delete in DynamoDB using AppSync and Amplify

I'm a newbie to DynamoDB and AppSync. I have a Tasks table and a TaskType table. type TaskType @model @key(name: "tasktypesOrgIndex", fields: ["orgID"], queryField: "tasktypesByOrganization") { id: ID! orgID: ID! name: String! description:…
1
vote
2 answers

Getting AWS cognito authenticated user in post-authentication lambda trigger

I'm using Amplify with the Cognito backend to authenticate my users, essentially as an LDAP impl. This is all configured and working just fine. The users are setup in the user pool, and authenticated properly. (Note: I'm using the default Amplify…