on 10-18-2018 4:56 PM
Dear expert
I have build an AssetManager 2.0 mobile application for xcode simulator and when i sign in the mobile app i am getting this error (see screenshot)
=> OAuth2Error.tokenRejected: The newly acquired or refreshed token got rejected.
User is not registered in SAPcpms.
With Postman: I am able to
- authenticate (thru SAPcpms)
- register user in SAPcpms
- access a SAPcpmsDestination https://mobilepreview-sfxxxxxxxxx.eu3.hana.ondemand.com/DEST_SAM20_PPROP/$metadata with an access token.
Thanks for your help. Regards.
It is working now.....
"SapCloudPlatformEndpoint" in BrandedSettings.json was incorrect
"https://mobile-xxx.eu3.hana.ondemand.com" instead of "https://mobilepreview-xxx.eu3.hana.ondemand.com",
Thanks for help. Regards.You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Didier,
Please check the Url value defined in the Destination DEST_SAM20_PPROP ( SAP Cloud Platform Mobile Services) it should be as follows: http://<cloud connector virtual host>:<cloud connector virtual port> /sap/opu/odata/<mobile add-on component>/<mobile add-on service>
for example: http://fqdn:port/sap/opu/odata/MERP/SAP_ASSET_MANAGER_20
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill,
I have checked this, but it seems correct. I have enclosed hereafter the lines containing "http" in the log.
You can see:
<-> url: https://accounts.sap.com/saml2/idp/sso/accounts.sap.com
<-> url: https://oauthasservices-sfxxxxxxx.eu3.hana.ondemand.com/?code=***
<-> url: https://oauthasservices-sfxxxxxxx.eu3.hana.ondemand.com/oauth2/api/v1/token
2018-10-18 17:04:21.273161+0200 SWIMAssetManager20[17925:715360] [general] # SAP.Foundation.Authentication.OAuth2Observer - ERROR - (0x60c00026ebc0) - OAuth2Observer.swift.process(task:response:completionHandler:) - Rejected - This request has already authenticated and the new credentials got rejected!
From that, i think that the app is
- authenticating successfully to SCP
- getting an authorization code using the clientid
- getting an access token
but the access token seems rejected by app => ERROR - (0x60c00026ebc0) - OAuth2Observer.swift.process(task:response:completionHandler:) - Rejected - This request has already authenticated and the new credentials got rejected!
Thanks for help. Regards.
(/Users/xxxxxx/Desktop/SWIM/AssetManager/AssetManager2.0/MDKClient_SDK/SWIMAssetManager2.0/platforms/ios/SWIMAssetManager20/app/branding/BrandedSettings.json)
{
"ApplicationDisplayName": "SWIM Asset Manager 2.0",
"ConnectionSettings": {
"EnableOverrides": false,
"AppId": "com.xxx.meridia.swim.AssetManager",
"ClientId": "xxxxxx-1fa4-4d2e-9282-8d53e9a6dd63",
"SapCloudPlatformEndpoint": "https://mobile-xxxxxx.eu3.hana.ondemand.com",
"AuthorizationEndpointUrl": "https://oauthasservices-xxxxxx.eu3.hana.ondemand.com/oauth2/api/v1/authorize",
"RedirectUrl": "https://oauthasservices-xxxxxx.eu3.hana.ondemand.com",
"TokenUrl": "https://oauthasservices-xxxxxx.eu3.hana.ondemand.com/oauth2/api/v1/token",
"ServiceTimeZoneAbbreviation": "CET"
},
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would start by checking your connection settings. If your client id is incorrect or there are issues in the URLs that might explain the error.
In particular make sure the SapCloudPlatformEndpoint does not end with a slash character "/".
--Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.