Cordoba Android application receives "invalid_client" from MobileFirst 8.0 server

The My Cordova IOS app, integrated with IBM MobileFirst v8, works great. However, I ran into a strange problem with Android .

Scenario, The user must log into the security check system in order to access the application.

The call handler is called and the credentials are passed (runtime / api / preauth / v1 / preauthorize). I see that the security check is being checked in the log.

I can see the next call to the authorization endpoint (runtime / api / az / v1 / authorization)

However, I see the difference between Android and IOS in the parameters passed to this endpoint.

Android

  response_type = code
     scope =
     client_id =
     redirect_uri = http: //mfpredirecturi&isAjaxRequest=true&x=0.9217767383903592

A subsequent call to the marker generation endpoint does not work for Android. / runtime / api / az / v 1 / token HTTP / 1.1 "400 {status: 400, errorCode:" invalid_client ", description:" Invalid JWT format "}

IOS

  response_type = code
     scope =
     client_id =
     redirect_uri = http% 3A // mfpredirecturi

WLAuthorizationManager.login (SECURITY_CHECK_NAME, credentials) triggers / pre-authorization call

cordova-mfp-plugin (8.0.2016110713) cordova-android (5.2.0)

My main suspect is redirect_uri, which is not Android-only encoded. This is problem? is it possible to encode and send redirect_uri from cordova app?

+5
source share
1 answer

You can try the new MFP adapter plugin in your pom.xml

<build> <plugins> <plugin> <groupId>com.ibm.mfp</groupId> <artifactId>adapter-maven-plugin</artifactId> <version>8.0.2017021701</version> <extensions>true</extensions> </plugin> </plugins> </build> 

This version of the adapter plugin works great.

0
source

Source: https://habr.com/ru/post/1261574/


All Articles