Store Facebook Credential in Android for Google Smart Lock Password

坚强是说给别人听的谎言 提交于 2019-12-01 16:49:36

I was able to get what I believe to be a working version of Smart Lock saving Facebook login credentials.

My app uses the FB API to login. From there I send a token to my server which in turn sends back the users email and username. I store that information like so:

    Credential credential = new Credential.Builder(user.getEmail())
       .setAccountType(IdentityProviders.FACEBOOK)
       .setName(user.getName())
       .build();

I'm not completely familiar with the Facebook API, but I think you could get the email and username from the Facebook SDK.

After using this to save the users FB credentials I am able to view them on passwords.google.com. The password shows as "With Facebook".

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!