Я пытаюсь получить AccessToken с сервера на основе OAuth2, используя неявное предоставление, используя AppAuth .
после этого приведенный ниже код перенаправляется в браузер для входа в систему
AuthorizationService service = new AuthorizationService(this,
new AppAuthConfiguration.Builder().setBrowserMatcher(blacklist).build());
service.performAuthorizationRequest(request,
PendingIntent.getActivity(this, request.hashCode(),new Intent(this,ReceiverActivity.class),0));
service.dispose();
Когда я возвращаюсь из браузера в приложение в ReceiverActivity, как указано в приведенном выше коде, тогда по адресу:
public viod onStart(){
AuthorizationResponse response = AuthorizationResponse.fromIntent(getIntent()); //null
AuthorizationException ex = AuthorizationException.fromIntent(getIntent());// exception below
}
{"type":0,"code":9,"errorDescription":"Response state param did not match request state"}
Другое:
AuthorizationRequest request = new AuthorizationRequest.Builder(
authorizationServiceConfiguration,
"clientid",
"token",
Uri.parse(CONSTANTS.REDIRECT_URL)
).setScope("crm_read")
.setAdditionalParameters(autoApprove)
.build();
Манифест
<activity android:name="net.openid.appauth.RedirectUriReceiverActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="${appAuthRedirectScheme}"
android:host="com.crm.crm"
android:path="/oauth2callback"/>
</intent-filter>
</activity>
Итак, почему я получаю эту ошибку {"type": 0, "code": 9, "errorDescription": "Параметр состояния ответа не соответствует состоянию запроса"}
мне нужно что-то установить по ссылке?