Hi @NimeshJarecha ,
Thank you for your help.
1. We are using a cross-platform app with native extensions (one for Android, one for iOS) and the authentication is actually done outside of our native code (where we have esri) and the token is stored on the backend which we just query later on in our native code and pass it to the challenge handler.
2. I was not 100% sure if I have to still do such a configuration but thinking it through it seems not, as we only receive a token to pass on to the challenge handler, so I removed that part.
3. I was using https://myarcgis.portal.com but as described above I just removed that part so I guess this is not relevant anymore.
4. I receive one challenge. challenge.remoteResource?.url is https://tiles.arcgis.com/tiles/B129y13w1XikjUdj/arcgis/rest/services/MyMapService/MapServerand challenge.request.url is https://www.arcgis.com/sharing/rest/generateToken
5. I'm not sure I know what you mean by federated token. But what is important that the same logic, with the same token works on Android but not on iOS. I personally haven't tested with my credentials but the logic works there.
6. Thank you for this debugging information, by using it I see the following in the log:
```
- response data **99 bytes**, `application/json;charset=utf-8`:
```json
{
"error" : {
"message" : "You do not have permissions to use this resource.",
"details" : null,
"code" : 403
}
}
```
```json
Error: domain=com.esri.arcgis.runtime.services.error, code=403, description="You do not have permissions to use this resource.", failureReason:"(null)"
```
-----
So, I believe is it a permission issue? I also paste the full log below, because I see one other error which I don't understand: 405 Method not supported, but it seems to go forward after this so maybe not relevant?
**------>> sending request** - `09/02/2024, 11:38:26 CET`
- [https://tiles.arcgis.com/tiles/B129y13w1XikjUdj/arcgis/rest/services/MyMapService/MapServer](https://tiles.arcgis.com/tiles/B129y13w1XikjUdj/arcgis/rest/services/MyMapService/MapServer?f=json)
- GET query:
```
{
f = json;
}
```
- request headers:
```
{
"User-Agent" = "ArcGISRuntime-iOS/100.15.4 (iPadOS 17.0.1; arm64; devmode) com.sap.mobile.apps.assetmanager/2405.0.0";
"x-dynatrace" = "MT_3_3_68355509852373928_17-0_c84a8791-6b51-4344-ab97-9117e6cbfc30_0_73479_71";
}
```
-----
**------>> sending request** - `09/02/2024, 11:38:26 CET`
- [https://tiles.arcgis.com/tiles/B129y13w1XikjUdj/arcgis/rest/info](https://tiles.arcgis.com/tiles/B129y13w1XikjUdj/arcgis/rest/info?f=json)
- GET query:
```
{
f = json;
}
```
-----
**<<------ received response** - `09/02/2024, 11:38:26 CET`
- [https://tiles.arcgis.com/tiles/B129y13w1XikjUdj/arcgis/rest/info](https://tiles.arcgis.com/tiles/B129y13w1XikjUdj/arcgis/rest/info?f=json)
- GET query:
```
{
f = json;
}
```
- response status code **200**
- response data **231 bytes**, `application/json;charset=utf-8`:
```json
{"owningSystemUrl":"https://www.arcgis.com","fullVersion":"10.8.1","owningTenant":"B129y13w1XikjUdj","currentVersion":10.81,"authInfo":{"tokenServicesUrl":"https://www.arcgis.com/sharing/generateToken","isTokenBasedSecurity":true}}
```
-----
**------>> sending request** - `09/02/2024, 11:38:26 CET`
- [https://www.arcgis.com/sharing/rest/generateToken](https://www.arcgis.com/sharing/rest/generateToken?f=json)
- GET query:
```
{
f = json;
}
```
-----
**<<------ received response** - `09/02/2024, 11:38:26 CET`
- [https://www.arcgis.com/sharing/rest/generateToken](https://www.arcgis.com/sharing/rest/generateToken?f=json)
- GET query:
```
{
f = json;
}
```
- response status code **200**
- response data **94 bytes**, `text/plain;charset=utf-8`:
```json
{
"error" : {
"code" : 405,
"messageCode" : "GWM_0005",
"message" : "Method not supported.",
"details" : [
]
}
}
```
```
Error: domain=com.esri.arcgis.runtime.services.error, code=405, description="Method not supported.", failureReason:"(null)"
```
-----
**------>> sending request** - `09/02/2024, 11:38:26 CET`
- [https://www.arcgis.com/sharing/rest/info](https://www.arcgis.com/sharing/rest/info?f=json)
- GET query:
```
{
f = json;
}
```
-----
**<<------ received response** - `09/02/2024, 11:38:27 CET`
- [https://www.arcgis.com/sharing/rest/info](https://www.arcgis.com/sharing/rest/info?f=json)
- GET query:
```
{
f = json;
}
```
- response status code **200**
- response data **156 bytes**, `text/plain;charset=utf-8`:
```
{"owningSystemUrl":"https://www.arcgis.com","authInfo":{"tokenServicesUrl":"https://www.arcgis.com/sharing/rest/generateToken","isTokenBasedSecurity":true}}
```
-----
**------>> sending request** - `09/02/2024, 11:38:27 CET`
- [https://www.arcgis.com/sharing/rest/](https://www.arcgis.com/sharing/rest/?f=json)
- GET query:
```
{
f = json;
}
```
-----
**<<------ received response** - `09/02/2024, 11:38:27 CET`
- [https://www.arcgis.com/sharing/rest/](https://www.arcgis.com/sharing/rest/?f=json)
- GET query:
```
{
f = json;
}
```
- response status code **200**
- response data **27 bytes**, `text/plain;charset=utf-8`:
```
{"currentVersion":"2023.3"}
```
-----
**------>> sending request** - `09/02/2024, 11:38:27 CET`
- [https://www.arcgis.com/sharing/rest/portals/self](https://www.arcgis.com/sharing/rest/portals/self?f=json&culture=en_HU)
- GET query:
```
{
culture = "en_HU";
f = json;
}
```
-----
**<<------ received response** - `09/02/2024, 11:38:27 CET`
- [https://www.arcgis.com/sharing/rest/portals/self](https://www.arcgis.com/sharing/rest/portals/self?f=json&culture=en_HU)
- GET query:
```
{
culture = "en_HU";
f = json;
}
```
- response status code **200**
- response data **10240 bytes**, `text/plain;charset=utf-8`:
```
{
2DStylesGroupQuery = "title:\"Esri 2D Styles\" AND owner:esri_en";
3DBasemapGalleryGroupQuery = "title:\"ArcGIS Online 3D Basemaps\" AND owner:esri";
analysisLayersGroupQuery = "title:\"Living Atlas Analysis Layers\" AND owner:esri";
basemapGalleryGroupQuery = "title:\"ArcGIS Online Basemaps\" AND owner:esri_en";
cdnUrl = "https://cdn.arcgis.com";
colorSetsGroupQuery = "title:\"Esri Colors\" AND owner:esri_en";
contentCategorySetsGroupQuery = "title:\"ArcGIS Online ...
```
-----
**------>> sending request** - `09/02/2024, 11:38:27 CET`
- [https://www.arcgis.com/sharing/rest/generateToken](https://www.arcgis.com/sharing/rest/generateToken?token=*****&serverUrl=https%3A%2F%2Ftiles.arcgis.com%2Ftiles&client=referer&referer=arcgisios&f=json)
- POST body:
```
{
client = referer;
f = json;
referer = arcgisios;
serverUrl = "https://tiles.arcgis.com/tiles";
}
```
- request headers:
```
{
"User-Agent" = "ArcGISRuntime-iOS/100.15.4 (iPadOS 17.0.1; arm64) com.sap.mobile.apps.assetmanager/2405.0.0";
"x-dynatrace" = "MT_3_3_68355509852373928_17-0_c84a8791-6b51-4344-ab97-9117e6cbfc30_0_259_80";
}
```
-----
**<<------ received response** - `09/02/2024, 11:38:27 CET`
- [https://www.arcgis.com/sharing/rest/generateToken](https://www.arcgis.com/sharing/rest/generateToken?token=*****&serverUrl=https%3A%2F%2Ftiles.arcgis.com%2Ftiles&client=referer&referer=arcgisios&f=json)
- POST body:
```
{
client = referer;
f = json;
referer = arcgisios;
serverUrl = "https://tiles.arcgis.com/tiles";
}
```
- response status code **200**
- response headers:
```
{
"Cache-Control" = "no-cache";
"Content-Encoding" = gzip;
"Content-Type" = "text/plain;charset=utf-8";
Date = "Fri, 09 Feb 2024 10:38:27 GMT";
Expires = "-1";
Pragma = "no-cache";
"Strict-Transport-Security" = "max-age=31536000";
Vary = "Origin, Accept-Encoding";
"x-content-type-options" = nosniff;
}
```
- response data **391 bytes**, `text/plain;charset=utf-8`:
```
{token:"*****","expires":1707476771801,"ssl":true}
```
-----
**------>> sending request** - `09/02/2024, 11:38:27 CET`
- [https://tiles.arcgis.com/tiles/B129y13w1XikjUdj/arcgis/rest/services/MyMapService/MapServer](https://tiles.arcgis.com/tiles/B129y13w1XikjUdj/arcgis/rest/services/MyMapService/MapServer?f=json)
- GET query:
```
{
f = json;
}
```
- request headers:
```
{
Referer = arcgisios;
"User-Agent" = "ArcGISRuntime-iOS/100.15.4 (iPadOS 17.0.1; arm64) com.sap.mobile.apps.assetmanager/2405.0.0";
"X-Esri-Authorization" = "*****";
"x-dynatrace" = "MT_3_3_68355509852373928_17-0_c84a8791-6b51-4344-ab97-9117e6cbfc30_0_259_83";
}
```
-----
**<<------ received response** - `09/02/2024, 11:38:27 CET`
- [https://tiles.arcgis.com/tiles/B129y13w1XikjUdj/arcgis/rest/services/MyMapService/MapServer](https://tiles.arcgis.com/tiles/B129y13w1XikjUdj/arcgis/rest/services/MyMapService/MapServer?f=json)
- GET query:
```
{
f = json;
}
```
- response status code **200**
- response headers:
```
{
"Cache-Control" = "private, no-cache, no-store, no-transform, must-revalidate, max-age=0, s-maxage=0";
"Content-Encoding" = gzip;
"Content-Type" = "application/json;charset=utf-8";
Date = "Fri, 09 Feb 2024 10:38:27 GMT";
"Strict-Transport-Security" = "max-age=63072000";
Vary = "Origin,Accept-Encoding,Authorization,X-Esri-Authorization";
Via = "1.1 4a0b7683a1d33d6d186965e831f2de96.cloudfront.net (CloudFront)";
"x-amz-cf-id" = "662YIV2XTQ9PsR08-bXLz-IxcWp_SdFohX-DY8SUu9q7Rbe232xzZA==";
"x-amz-cf-pop" = "FRA56-P7";
"x-arcgis-instance-id" = "i-0c903a2da99a46d4f";
"x-cache" = "Miss from cloudfront";
"x-content-type-options" = nosniff;
"x-powered-by" = "ArcGIS-Online-Hosted-Services";
"x-xss-protection" = "1; mode=block";
}
```
- response data **99 bytes**, `application/json;charset=utf-8`:
```json
{
"error" : {
"message" : "You do not have permissions to use this resource.",
"details" : null,
"code" : 403
}
}
```
```json
Error: domain=com.esri.arcgis.runtime.services.error, code=403, description="You do not have permissions to use this resource.", failureReason:"(null)"
```
-----