How can an application server associate Google accounts to a user's device?

前端 未结 2 977
北恋
北恋 2021-01-06 14:21

I want users to be able to enter data from a web server and/or native PC app and transfer it to their chosen Android device in much the same way that Google Play\'s install

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-06 15:02

    You should use the user_id that is returned from the Google account server after registration to uniquely identify each user. Email addresses shouldn't be used for a number of reasons:

    • Accessing email addresses may require additional permissions from the user and dissuade users from using your service/app because of trust issues.
    • Adds liability for securing database of users' email addresses
    • Users may change their email addresses in Google accounts but cannot change their user IDs.
    • Users can associate one email address with more than one user ID, so it is not necessarily unique.

    The following sequence diagram shows the initial registration from client Android app:

    initial registration from client Android app

    The next diagram shows what happens when a client wants to access his device from a browser:

    client wants to access his device from a browser

    Note that although not shown, the client Android app can now communicate back to the client browser if needed via the application server.

提交回复
热议问题