Our android app currently requires admin to confirm users before logging in the app through aws cognito. Users can then successfully login even though the email attribute is not verified. I don't have a problem requesting verification code or verifying users using the verification code.
My problem is how to check if a currently logged-in email is verified or not?
I searched a lot but cannot find anything.
You can get the user's attributes by calling getDetails
on the CognitoUser
instance providing it with a GetDetailsHandler
. This handler will be called with map of user attributes. Look for the following attributes:
phone_number_verified
email_verified
See the API docs here https://docs.aws.amazon.com/AWSAndroidSDK/latest/javadoc/
Note Confirmation can also be automated using the pre-signup
lambda hook - this is called auto confirm
. See:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.