google-auth-library-java icon indicating copy to clipboard operation
google-auth-library-java copied to clipboard

UserAuthorizer adds `approval_prompt=force` and conflicts with `prompt=consent`

Open arttom opened this issue 1 year ago • 0 comments

Environment details

  1. OS type and version: Any
  2. Java version: 21/any
  3. version(s): 1.23 (but code exists in the newest as well)

Steps to reproduce

  1. Using Google Ads library (v.31.0.0)
  2. Create Authorization request by URL
  3. It contains approval_prompt=force by default

Code example

UserAuthorizer userAuthorizer = UserAuthorizer.newBuilder()
                .setClientId(ClientId.of("123", null))
                .setScopes(Arrays.asList(googleProperties.ads().scopes().split(" ")))
                .setCallbackUri("/customer/google)
                .build();

        return userAuthorizer
                .getAuthorizationUrl(
                        userId,
                        state,
                        URI.create(serverHost),
                        Map.of("prompt", "consent"));

External references such as API reference guides

https://developers.google.com/identity/openid-connect/openid-connect#prompt

The approval_prompt is not even mentioned in the documentation

Any additional information below

After using it like this we get an error Conflict params: approval_prompt and prompt but there is no way to remove approval_prompt parameter, except manual operation after URL is created.

arttom avatar Jul 17 '24 11:07 arttom