Recently we tried to update the AppAuth-Android version used on our project from version 0.5.1.5 to 0.11.1. When successfully login from the browser and come back to the app, there is error data and we can't continue the process.
This is how we request:
AuthorizationServiceConfiguration configuration = new AuthorizationServiceConfiguration(Uri.parse(getAuthorizationRequestUrlWithParams(getBaseUrl(), getAuthorizationUrlParameters())), Uri.parse(getAccessTokenUrl()), null);
AuthorizationRequest.Builder authRequestBuilder = new AuthorizationRequest.Builder(
configuration,
mClientId,
"code token id_token",
Uri.parse(getCallbackURI()))
.setScope(getHybridScope());
Intent completionIntent = new Intent(context, tokenActivity);
Intent cancelIntent = getCancelIntent(context, cancelActivity);
CustomTabColorSchemeParams colorSchemeParams = new CustomTabColorSchemeParams.Builder()
.setToolbarColor(ContextCompat.getColor(context,R.color.grey120))
.setSecondaryToolbarColor(ContextCompat.getColor(context,R.color.black))
.build();
int flags = 0;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
flags |= PendingIntent.FLAG_MUTABLE;
}
mAuthService.performAuthorizationRequest(
authRequestBuilder.build(),
PendingIntent.getActivity(context, 0, completionIntent, flags),
PendingIntent.getActivity(context, 0, cancelIntent, flags),
mAuthService.createCustomTabsIntentBuilder()
.setDefaultColorSchemeParams(colorSchemeParams)
.build());
On authorization completed, the responseData has error data with description Response state param did not match request state.
After some debugging, we found out that on AuthorizationResponse.java there is a builder function that failed to get the query parameters from Uri which result in null value although the Uri string already contains all the data.
We also tried to setResponseMode to "form_post" on authRequestBuilder when requesting but it looks like it's still not supported.
Does anyone happen to solved this before? Thanks in advance.