Skip to content

Inquiry regarding the “Invalid user attributes: email” error when signing in with Google social login on a different device #5536

@masashi972

Description

@masashi972

Hello,

I'm implementing a social login feature using Google accounts in Swift.
I'm using the showSignIn method to authenticate users via the Google provider, as shown below:

// Option to launch Google sign-in directly
let hostedUIOptions = HostedUIOptions(scopes: ["openid", "email"], identityProvider: "Google")

// Present the Hosted UI sign-in screen
AWSMobileClient.default().showSignIn(
    navigationController: self.navigationController!,
    hostedUIOptions: hostedUIOptions
) { (userState, error) in
    if let error = error as? AWSMobileClientError {
        print(error.localizedDescription)
    }
    if let userState = userState {
        print("Status: $$userState.rawValue)")
    }
}

The initial sign-in completes successfully.
However, when I attempt to sign in with the same Google account on a different device (as part of testing a device replacement scenario), the showSignIn method throws the following error:

Error Domain=com.amazon.cognito.AWSCognitoAuthErrorDomain
Code=-3000 "(null)" 
UserInfo={error=invalid_request: Invalid user attributes: email: Attribute cannot be updated.}

Could you please advise how I can resolve or work around this error?

  • AWSMobileClient version: v2.13.6

Thank you very much in advance for your support.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions