Google OAuth2 re-authorization is missing permissions on the consent page

前端 未结 2 2033
忘了有多久
忘了有多久 2021-02-04 16:34

When I force a user to re-authorize my application a second time, using approval_prompt=force, how can I get Google to show the user the entire list of permissions

2条回答
  •  别那么骄傲
    2021-02-04 16:49

    You have to revoke the access token and log out. Then if you go to sign in process, It will show the permission.

    public static void RevokeAcess(String accessOrRefreshToken) throws ClientProtocolException, IOException
    {
        HttpClient client = new DefaultHttpClient();
        HttpPost post = new HttpPost("https://accounts.google.com/o/oauth2/revoke?token="+accessOrRefreshToken);
        client.execute(post);
    }
    

    This network process should be called in non ui thread or asyntask

提交回复
热议问题