Hi colleagues,
I am encountering an error while querying the backend system from an Android application via HCP Mobile Services.
De Detailed scenario
- A Cordova application deployed on an Android platform reads data from a web application via the Mobile services platform.
- Web application deployed on HCP, running, contains data.
- HCP account uses the default local service provider and the default trusted identity provider.
- The application, at launch, successfully authenticates against the mobile services using basic authentication configuration. The username and password are correct.
- After authentication, application sends successive Ajax queries to the mobile services, which redirects them to the backend system, in order to retrieve data. An error occurs on the first call.
The error: detailed
- Instead of the expected Json data, the following HTML is returned. The page is the same regardless of which client is used (Android app or Postman). (Apologies for the poor formatting, the "Insert Raw HTML" option isn't working too well).
<html>
<head>
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="pragma" content="no-cache" />
</head>
<body style="background-color:#FFFFFF" onload="var url=window.location.hash;if(url&&0!==url.length){var anchorCookie='oucrswcyzlzsqgnrqjjsuklxd_anchor="'+encodeURIComponent(url)+'"';document.cookie=anchorCookie}document.forms[0].submit()">
<p>
<script language="javascript">document.write("Please wait ...");</script>
</p>
<noscript>
<p>Note: Your browser does not support JavaScript or it is turned off. Press the button to proceed.</p>
</noscript>
<form method="post" action="https://accounts.sap.com/saml2/idp/sso/accounts.sap.com">
<input type="hidden" name="SAMLRequest" value="PEF1dGhuUmVxdWVzdCB4bWxucz0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnByb3RvY29sIiB4bWxuczpuczI9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIHhtbG5zOm5zMz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2lnIyIgeG1sbnM6bnM0PSJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGVuYyMiIEFzc2VydGlvbkNvbnN1bWVyU2VydmljZVVSTD0iaHR0cHM6Ly9yb290YzUyMjc4MzB0cmlhbC5oYW5hdHJpYWwub25kZW1hbmQuY29tL1NlcnZpY2VzLnN2Yy9Db21wYW55TG9jYXRpb25zPyRmb3JtYXQ9anNvbi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3RNZXRob2QgQWxnb3JpdGhtPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjc2hhMSIvPjxkczpEaWdlc3RWYWx1ZT5pVTRmNGhjblRYdEx2TytwMFErMnA4bGRKOVU9PC9kczpEaWdlc3RWYWx1ZT48L2RzOlJlZmVyZW5jZT48L2RzOlNpZ25lZEluZm8+PGRzOlNpZ25hdHVyZVZhbHVlPmJSYlNwTnBaUWhpN2ttcjRGM3ptZHZxZzBpbEZrTGt3L09qQ3Y3RndmYzFnLzFlQ1J5Y2Q0cUdxZGMyc2J6S3FWTXFFSjR1czY0ZFhrZ3FmMXg1TXZCdFFqcFRtekJETUxjc3lET1MyT09CS1hiMHAvNm11QWdsVk82dlFFdUpRdFlSd2Jaa2lZeWZkWThRTTF3SEMxRG1kK09WdERMNTlMUVNtWUJFbThSKzErNUw1VG8rME5MTGtkWmkrNEZHOTBFSXhrcXhFUy9admZMcW9RQ3VCdkZRSW1qV05NbUtJVDJad2ozVUFCR3d6Qjl4blhIRXNVeGF4ZXNIZlFZM0Rid3pJa2UycXFDUWVzRlV3eEFvV21ZZ2NSUkozSm1ZRE5SY1hwcnhCYkZQazdreUV3bExzQy9UMFFaLzFzVCttT011Q3Y2L0VCamFpSWRjZlprSk8rZz09PC9kczpTaWduYXR1cmVWYWx1ZT48L2RzOlNpZ25hdHVyZT48L0F1dGhuUmVxdWVzdD4="/>
<input type="hidden" name="RelayState" value="oucrswcyzlzsqgnrqjjsuklxd"/>
<noscript>
<input type="submit" value="Continue"/>
</noscript>
</form>
</body>
</html>
- When run in a web browser, the HTML page redirects to the backend system URL, and then displays an error in Json format : “The request dispatcher does not allow the HTTP method used for the request”. The link to which the page redirects, when executed independently, returns the correct data from the backend system. The error, therefore, seems to be in the authentication of the mobile services system against the backend. The Javascript code which needs to be executed to authenticate cannot be run, seemingly.
What I have tried
- I have tried regenerating the authentication request, as detailed in this post : https://scn.sap.com/thread/3333160 , to no avail. This is not a "session expired after 30 minutes" issue.
- Not a credentials issue (the authentication process cannot begin).
- I tried setting the local service provider to "None" on HCP, and configuring the authentication type of the backend of the Mobile Services application to "No authentication", unsuccessfully.
- I have ensured that the HTTP request header with key X-SMP-APPCID matched a key registered with the mobile services.
- Different configuration scenarios for the Mobile Services application, with no differences in the Ajax query response.
- I contacted the SAP ID services support team, this is not an issue with SAP ID.
I really don't know where to look anymore. Has anyone ever encountered this error?
Thanks,
Christopher.