oAuth token for multiple services

2019-09-02 19:02发布

I have a Dropbox account which was created by logging in via the Google account. So, my Dropbox account is linked to the Google account.

I have an android application and my users can create their accounts either via Google/Facebook.

The question is,if it is possible for the user to login to our app once via his Google Account, and then using these same underlying google's credentials the user automatically gets logged in to Dropbox Account [Maybe a simple 'OK' button authentication is needed], so that they need not enter their login credentials twice?

I am planning to implement this using oAuth. Any guidance on whether is possible or not will be helpful. I am not expecting code but some guidance.

1条回答
乱世女痞
2楼-- · 2019-09-02 20:00

In general what you are asking is not possible. The credentials/assertions that Google issues are for a specific app and only that app should accept those credentials. So when a user signs into your app, you get a credentials from Google that says this is for your app. Also Dropbox accepts credentials from Google that was issued for Dropbox. Your app can not convert one into another (if it could this would be a big security issue e.g. one app could sign into a user's all other apps/account that accept Google credentials for expalple bank account).

What you want to do is integrate with the OAuth Apis that are from Dropbox and when the user is going through them try to prefill information to make the flow easier. If you send "user email" to Google OAuth flow (to get user signed into dropbox) for the same user (who is signed in) they could go through the flow easily. https://developers.google.com/identity/protocols/OpenIDConnect#sendauthrequest

查看更多
登录 后发表回答