I'd like to try using an InstanceID
to authenticate my Android app with my database server (PHP/MySQL). I'm stuck, with some missing pieces of the puzzle. As I understand it, the process goes something like this:
- Get an API Key and a
PROJECT_ID
from the Google Developer Console. - Create a "scope" String that apparently identifies the server functions the app is allowed to access.
- In my app, call
mInstanceID.getId()
to get the InstanceID, and store locally. - In my app, call
getToken( PROJECT_ID, scope )
to get the access token. - Include the token somehow in requests to the server. (How?)
- ....and...?
The big missing piece is: how does the server learn about the existence of this token? I can't find any documentation on this. I presume that the "scope" value is encoded somehow in the token, and somehow the server receives it and can examine it to decide if the request is permitted. How does this happen?