Hybrid Grant Type
I've the following auth request:
final HashMap<String, String> additionalParameters = new HashMap<>();
additionalParameters.put(Constants.PARAM_GRANT_TYPE, Constants.GRANT_TYPE_HYBRID);
[...]
AuthorizationRequest.Builder authRequestBuilder = new AuthorizationRequest.Builder(
serviceConfiguration,
Constants.CLIENT_ID,
Constants.RESPONSE_TYPE_CODE_ID_TOKEN,
Uri.parse(Constants.LOGIN_REDIRECT_URI))
.setScope(Constants.SCOPE)
.setAdditionalParameters(additionalParameters);
And this is working fine. Now I need to manually build a Token request:
final HashMap<String, String> additionalParameters = new HashMap<>();
additionalParameters.put(Constants.PARAM_GRANT_TYPE, Constants.GRANT_TYPE_HYBRID);
TokenRequest.Builder tokenRequestBuilder = new TokenRequest.Builder(serviceConfiguration, Constants.CLIENT_ID);
tokenRequestBuilder
.setAuthorizationCode(resp.authorizationCode)
.setGrantType(Constants.GRANT_TYPE_HYBRID)
.setAdditionalParameters(additionalParameters)
.setRedirectUri(Uri.parse(Constants.LOGIN_REDIRECT_URI));
The library complains that I have to use setGrantType method to pass "hybrid" and not the additional parameter, but this way I get a "unsupported_grant_type" error. I'd like to use the additional parameter. Any way to override this behaviour? Many thanks in advance.
Having looked through the code I don't see any issue. If you match the same additional parameter the library prompts you to use the designated builder function which should do exactly the same as passing the value via the map.
While this is an old issue it may still be relevant so I'll leave it open in case somebody can add further information after my reply.