aws-amplify / aws-sdk-ios

AWS SDK for iOS. For more information, see our web site:
https://aws-amplify.github.io/docs
Other
1.68k stars 885 forks source link

Best practice for using device biometric authentication like FaceID and TouchID #2583

Closed deepeshsunku closed 4 years ago

deepeshsunku commented 4 years ago

State your question

Hello, what is the best practice for using cognito authentication with device biometric authentication like FaceID and TouchID?

Want to provide an option to the user to authenticate via FaceID/TouchID for consequent logins after logging in using username/password for the first time.

lawmicha commented 4 years ago

Hi @deepeshsunku I think you will have to first get the user to login, store the credentials in their keychain, then that will enable the ability to use touchId/faceId. upon authenticating with touchId/faceId, you can retrieve the credentials from keychain and log them back in using the regular AWSMobileClient signIn method

https://developer.apple.com/documentation/localauthentication

stale[bot] commented 4 years ago

This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems.

AllioNicholas commented 3 years ago

store the credentials in their keychain

@lawmicha does this mean that credentials are stored in plain text?

lawmicha commented 3 years ago

store the credentials in their keychain

@lawmicha does this mean that credentials are stored in plain text?

I don’t think so, I haven’t tried so myself but it looks like Apple provides a secure way to do it

https://developer.apple.com/documentation/security/keychain_services/keychain_items/adding_a_password_to_the_keychain

pzmudzinski commented 3 years ago

@lawmicha I assume you meant login via email/password but what about Google/Apple/Facebook sign in? If user logs in with email and password we actually can save those in keychain and use it later for automatic login but what about social platforms? SDK does not expose anything which could be used for further relogin.

pzmudzinski commented 2 years ago

I assume answer is no - it's only viable for email/pwd login. Implemented it using LocalAuthentication framework.