Google Api and android Oauth INVALID_AUDIENCE error

后端 未结 5 1030
梦毁少年i
梦毁少年i 2020-12-31 05:09

I am getting a GoogleAuthException: Unknown error, while doing a GoogleAuthUtil.getToken.

Just before the exception I see



        
5条回答
  •  旧时难觅i
    2020-12-31 05:45

    Looks like that should work; here's the scope-init code from my app which does work.

    private static final String SCOPE = "audience:server:client_id:" + SERVER_CLIENT_ID;
    

    So it smells to me like there's a problem with the client id. Remember that

    1. You have to have a project with two client ids
    2. One is the one for your android app, with the SHA & package & so on
    3. The other is for the server side that you're going to send the token off to

    It's the client ID from #3 that goes after ...:client_id:

提交回复
热议问题