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.