I was using google smart lock in one of my android applications. I am facing some problems in integrating smart lock to my app for login methods involving oauth. I am using google, facebook oauth as login methods and they return an oauth token and an oauth secret which I send to my server for authentication.
Now, how do I implement google smart lock for these methods?
How can I save these credentials with smart lock so that when I read the credentials later on, I may retrieve them and use them for authentication?
Is it even possible to implement google smart lock feature with custom oauth methods? I looked at many sources on the internet but couldn't find any solutions to this problem. Any help would be appreciated.
It's not possible to store tokens with the current Smart Lock API, but you can store which type of account the user selected. For example, to remember that the user used OAuth with Google, create a credential like this:
You can define your own account types. If the provided email addresses matches a Google Account on the device, this entry can be stored automatically; otherwise, the user will need to confirm which Google Account to save the data with.
You can then retreive this information later on another device or after the user's session expires and automatically kick-off a sign-in flow for this OAuth provide. For example, with Google:
As described in the documentation: https://developers.google.com/identity/smartlock-passwords/android/retrieve-credentials