<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: authenticationManager didReceive challenge not working with previously received token in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/authenticationmanager-didreceive-challenge-not/m-p/1381362#M7730</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/763512"&gt;@zdtorok&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;I receive one challenge. challenge.remoteResource?.url is&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;A href="https://tiles.arcgis.com/tiles/B129y13w1XikjUdj/arcgis/rest/services/MyMapService/MapServer" target="_blank" rel="nofollow noopener noreferrer"&gt;https://tiles.arcgis.com/tiles/B129y13w1XikjUdj/arcgis/rest/services/MyMapService/MapServer&lt;/A&gt;&lt;/STRONG&gt;&lt;SPAN&gt;and challenge.request.url is &lt;/SPAN&gt;&lt;STRONG&gt;&lt;A href="https://www.arcgis.com/sharing/rest/generateToken" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.arcgis.com/sharing/rest/generateToken&lt;/A&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The challenge is issued for the portal (&lt;STRONG&gt;&lt;A href="https://www.arcgis.com/sharing/rest/generateToken" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.arcgis.com&lt;/A&gt;&lt;/STRONG&gt;) and the layer (&lt;STRONG&gt;&lt;A href="https://tiles.arcgis.com/tiles/B129y13w1XikjUdj/arcgis/rest/services/MyMapService/MapServer" target="_blank" rel="nofollow noopener noreferrer"&gt;https://tiles.arcgis.com/tiles/B129y13w1XikjUdj/arcgis/rest/services/MyMapService/MapServer&lt;/A&gt;&lt;/STRONG&gt;) is federated with the portal. The credential with token you are providing is the portal token. The following request creates a federated token with the token you have provided.&lt;/P&gt;&lt;PRE&gt; - [https://www.arcgis.com/sharing/rest/generateToken](https://www.arcgis.com/sharing/rest/generateToken?token=*****&amp;amp;serverUrl=https%3A%2F%2Ftiles.arcgis.com%2Ftiles&amp;amp;client=referer&amp;amp;referer=arcgisios&amp;amp;f=json)  
 - POST body:  
```
{
    client = referer;
    f = json;
    referer = arcgisios;
    serverUrl = "https://tiles.arcgis.com/tiles";
}
```  &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The layer is not accessible with the federated token and fails with an error.&lt;/P&gt;&lt;PRE&gt;{
  "error" : {
    "message" : "You do not have permissions to use this resource.",
    "details" : null,
    "code" : 403
  }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error for another layer seems to indicate the same that it is not accessible with the given token.&lt;/P&gt;&lt;PRE&gt;{
  "error" : {
    "code" : 403,
    "message" : "Subscription is disabled, the item is not accessible",
    "messageCode" : "SB_0005",
    "details" : [
      "Subscription is disabled, the item is not accessible"
    ]
  }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Another strange issue, can it happen that for the same user for the same resource with the same token handling, on iOS we receive an 403 error but on Android it works&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I doubt, but would like to see the side-by-side logs with actual token values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nimesh&lt;/P&gt;</description>
    <pubDate>Mon, 12 Feb 2024 23:28:33 GMT</pubDate>
    <dc:creator>NimeshJarecha</dc:creator>
    <dc:date>2024-02-12T23:28:33Z</dc:date>
    <item>
      <title>authenticationManager didReceive challenge not working with previously received token</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/authenticationmanager-didreceive-challenge-not/m-p/1379662#M7724</link>
      <description>&lt;P&gt;We are using OAuth2 authorization to fetch an access token after logging in on the ESRI portal, and using that token later to authenticate basemaps.&lt;/P&gt;&lt;P&gt;Once the login page is dismissed we return to our mobile app with a redirect URL and store the token.&lt;/P&gt;&lt;P&gt;The token is requested via the Rest API described here:&amp;nbsp;&lt;A href="https://developers.arcgis.com/rest/users-groups-and-items/authorize.htm" target="_blank"&gt;https://developers.arcgis.com/rest/users-groups-and-items/authorize.htm&lt;/A&gt;. We are using &lt;FONT face="courier new,courier"&gt;response_type='code'&lt;/FONT&gt; and no &lt;FONT face="courier new,courier"&gt;referer&lt;/FONT&gt; therefore.&lt;/P&gt;&lt;P&gt;Later, we did the following:&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;... {
    let challengeHandler = EsriAuthenticationChallengeHandler.shared
    challengeHandler.delegate = self
    AGSAuthenticationManager.shared().delegate = challengeHandler
    let oAuthConfiguration = AGSOAuthConfiguration(portalURL: portalURI,
                                                   clientID: clientID,
                                                   redirectURL: redirectURL)
    AGSAuthenticationManager.shared().oAuthConfigurations.add(oAuthConfiguration)
}

class EsriAuthenticationChallengeHandler: NSObject, AGSAuthenticationManagerDelegate {
    static let shared = EsriAuthenticationChallengeHandler()

    func authenticationManager(_ authenticationManager: AGSAuthenticationManager, didReceive challenge: AGSAuthenticationChallenge) {
        guard challenge.type == .oAuth else { return }
        challenge.continue(with: AGSCredential(token: esriToken, referer: nil))
    }
}&lt;/LI-CODE&gt;&lt;P&gt;The token is correct, double checked that, but still nothing happens, the basemap itself is not rendered.&lt;/P&gt;&lt;P&gt;If I simply remove the `&lt;FONT face="courier new,courier"&gt;didReceive challenge:&lt;/FONT&gt;` method, it correctly displays the alert to require the username and password.&lt;/P&gt;&lt;P&gt;Am I missing something?&amp;nbsp;Any help is appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 14:52:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/authenticationmanager-didreceive-challenge-not/m-p/1379662#M7724</guid>
      <dc:creator>zdtorok</dc:creator>
      <dc:date>2024-02-08T14:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: authenticationManager didReceive challenge not working with previously received token</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/authenticationmanager-didreceive-challenge-not/m-p/1379675#M7725</link>
      <description>&lt;P&gt;Additional note: when checking the &lt;FONT face="courier new,courier"&gt;challenge.error&lt;/FONT&gt;, it shows &lt;EM&gt;"Token Required"&lt;/EM&gt;, error code 499, which is what I expected, but even after I try to continue the challenge (as described in the post above) with the token, it still has this error and no map is displayed.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 14:56:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/authenticationmanager-didreceive-challenge-not/m-p/1379675#M7725</guid>
      <dc:creator>zdtorok</dc:creator>
      <dc:date>2024-02-08T14:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: authenticationManager didReceive challenge not working with previously received token</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/authenticationmanager-didreceive-challenge-not/m-p/1379867#M7726</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/763512"&gt;@zdtorok&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like know few things to narrow down the issue as well as understand your code and what you are trying to achieve.&lt;/P&gt;&lt;P&gt;1. What is the motivation of having your own OAuth implementation and generating tokens rather than using SDK's OAuth implementation?&lt;/P&gt;&lt;P&gt;2. If you are generating OAuth tokens on your own why are you providing the OAuth configuration on `&lt;SPAN&gt;AGSAuthenticationManager&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;shared&lt;/SPAN&gt;&lt;SPAN&gt;().&lt;/SPAN&gt;&lt;SPAN&gt;oAuthConfigurations`?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3. What is the portal url and basemaps url looks like?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;4. How many challenges are issued and what are their request URLs?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;5. Is basemap service federated with the portal you are generating OAuth token? If yes, you will have to generate a federated token using the portal (OAuth) token you have generated. See&amp;nbsp;&lt;A href="https://developers.arcgis.com/rest/users-groups-and-items/generate-token.htm" target="_blank"&gt;https://developers.arcgis.com/rest/users-groups-and-items/generate-token.htm&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;6. The SDK provides a way to debug the requests and responses. Please use following code and provide the&amp;nbsp;&lt;/SPAN&gt;generated log file.&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;let config = AGSRequestConfiguration.global()
config.debugLogFileURL = URL(fileURLWithPath: “&amp;lt;path to .md file”)
config.debugLogRequests = true
config.debugLogIncludeRequestHeaders = true
config.debugLogResponses = true
config.debugLogIncludeResponseHeaders = true
config.debugLogResponseTrimThreshold = 500
config.debugLogIgnoreTiledLayerRequests = true&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nimesh&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 17:51:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/authenticationmanager-didreceive-challenge-not/m-p/1379867#M7726</guid>
      <dc:creator>NimeshJarecha</dc:creator>
      <dc:date>2024-02-08T17:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: authenticationManager didReceive challenge not working with previously received token</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/authenticationmanager-didreceive-challenge-not/m-p/1380236#M7727</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1055"&gt;@NimeshJarecha&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;3. I was using &lt;A href="https://myarcgis.portal.com" target="_blank"&gt;https://myarcgis.portal.com&lt;/A&gt;&amp;nbsp;but as described above I just removed that part so I guess this is not relevant anymore.&lt;/P&gt;&lt;P&gt;4. I receive one challenge. challenge.remoteResource?.url is&amp;nbsp;&lt;STRONG&gt;&lt;A href="https://tiles.arcgis.com/tiles/B129y13w1XikjUdj/arcgis/rest/services/MyMapService/MapServer" target="_blank"&gt;https://tiles.arcgis.com/tiles/B129y13w1XikjUdj/arcgis/rest/services/MyMapService/MapServer&lt;/A&gt;&lt;/STRONG&gt;and challenge.request.url is &lt;STRONG&gt;&lt;A href="https://www.arcgis.com/sharing/rest/generateToken" target="_blank"&gt;https://www.arcgis.com/sharing/rest/generateToken&lt;/A&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;6. Thank you for this debugging information, by using it I see the following in the log:&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;```  

 - 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)"
```  

-----  &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;**------&amp;gt;&amp;gt; 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";
}
```  

-----  

**------&amp;gt;&amp;gt; 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;
}
```  

-----  

**&amp;lt;&amp;lt;------ 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}}
```  

-----  

**------&amp;gt;&amp;gt; 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;
}
```  

-----  

**&amp;lt;&amp;lt;------ 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)"
```  

-----  

**------&amp;gt;&amp;gt; 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;
}
```  

-----  

**&amp;lt;&amp;lt;------ 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}}
```  

-----  

**------&amp;gt;&amp;gt; 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;
}
```  

-----  

**&amp;lt;&amp;lt;------ 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"}
```  

-----  

**------&amp;gt;&amp;gt; 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&amp;amp;culture=en_HU)  
 - GET query:  
```
{
    culture = "en_HU";
    f = json;
}
```  

-----  

**&amp;lt;&amp;lt;------ 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&amp;amp;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 ...
```  

-----  

**------&amp;gt;&amp;gt; sending request**  - `09/02/2024, 11:38:27 CET`  

 - [https://www.arcgis.com/sharing/rest/generateToken](https://www.arcgis.com/sharing/rest/generateToken?token=*****&amp;amp;serverUrl=https%3A%2F%2Ftiles.arcgis.com%2Ftiles&amp;amp;client=referer&amp;amp;referer=arcgisios&amp;amp;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";
}
```  

-----  

**&amp;lt;&amp;lt;------ received response**  - `09/02/2024, 11:38:27 CET`  

 - [https://www.arcgis.com/sharing/rest/generateToken](https://www.arcgis.com/sharing/rest/generateToken?token=*****&amp;amp;serverUrl=https%3A%2F%2Ftiles.arcgis.com%2Ftiles&amp;amp;client=referer&amp;amp;referer=arcgisios&amp;amp;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}
```  

-----  

**------&amp;gt;&amp;gt; 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";
}
```  

-----  

**&amp;lt;&amp;lt;------ 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)"
```  

-----  &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 10:44:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/authenticationmanager-didreceive-challenge-not/m-p/1380236#M7727</guid>
      <dc:creator>zdtorok</dc:creator>
      <dc:date>2024-02-09T10:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: authenticationManager didReceive challenge not working with previously received token</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/authenticationmanager-didreceive-challenge-not/m-p/1380248#M7728</link>
      <description>&lt;P&gt;I noticed we might receive another challenge to, not clear yet why, but we have.&lt;/P&gt;&lt;P&gt;The auth request url is the same as above and the resource is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="https://services1.arcgis.com/B129y13w1XikjUdj/arcgis/rest/services/authenticatedlayer/FeatureServer/0" target="_blank"&gt;https://services1.arcgis.com/B129y13w1XikjUdj/arcgis/rest/services/authenticatedlayer/FeatureServer/0&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;**&amp;lt;&amp;lt;------ received response**  - `09/02/2024, 12:48:37 CET`  

 - [https://services1.arcgis.com/B129y13w1XikjUdj/arcgis/rest/services/usace_regulatory_boundary/FeatureServer/0](https://services1.arcgis.com/B129y13w1XikjUdj/arcgis/rest/services/usace_regulatory_boundary/FeatureServer/0?f=json&amp;amp;returnAdvancedSymbols=true)  
 - GET query:  
```
{
    f = json;
    returnAdvancedSymbols = true;
}
```  

 - response status code **200**  

 - response headers:  

```
{
    "Access-Control-Allow-Origin" = "*";
    "Cache-Control" = "no-cache";
    "Content-Encoding" = br;
    "Content-Length" = 106;
    "Content-Type" = "application/json; charset=utf-8";
    Date = "Fri, 09 Feb 2024 11:48:37 GMT";
    Expires = "-1";
    Pragma = "no-cache";
    "Strict-Transport-Security" = "max-age=63072000";
    Vary = "X-Esri-Authorization";
    Via = "1.1 63f49fb8153ef60b0374321d41a091c6.cloudfront.net (CloudFront)";
    "request-context" = "appId=cid-v1:02d88829-cd35-4b36-83db-f89bb9f85514";
    "x-amz-cf-id" = "WBXpDfylH8x6JXjO2GQ6g9jGINXkzAQlSauzRmgGgxKbHLAutqi2xg==";
    "x-amz-cf-pop" = "BUD50-P2";
    "x-arcgis-correlation-id" = "00-6257df42e3fcde797f549244e8589879-15c3d9269b4526f0-00";
    "x-arcgis-instance" = i7tdixsfq00000H;
    "x-arcgis-trace-id" = 6257df42e3fcde797f549244e8589879;
    "x-arcgis-upstream" = us1h01c00;
    "x-cache" = "Miss from cloudfront";
}
```  

 - response data **178 bytes**, `application/json; charset=utf-8`:  

```json
{
  "error" : {
    "code" : 403,
    "message" : "Subscription is disabled, the item is not accessible",
    "messageCode" : "SB_0005",
    "details" : [
      "Subscription is disabled, the item is not accessible"
    ]
  }
}
```  

```json
Error: domain=com.esri.arcgis.runtime.services.error, code=403, description="Subscription is disabled, the item is not accessible", failureReason:"Subscription is disabled, the item is not accessible"
```  

----- &lt;/LI-CODE&gt;&lt;P&gt;This is the log which gives a slightly different 403 error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 11:50:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/authenticationmanager-didreceive-challenge-not/m-p/1380248#M7728</guid>
      <dc:creator>zdtorok</dc:creator>
      <dc:date>2024-02-09T11:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: authenticationManager didReceive challenge not working with previously received token</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/authenticationmanager-didreceive-challenge-not/m-p/1380257#M7729</link>
      <description>&lt;P&gt;Another strange issue, can it happen that for the same user for the same resource with the same token handling, on iOS we receive an 403 error but on Android it works? One of my colleague seems to have it working on Android but on iOS it's not working with the same credentials.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 12:57:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/authenticationmanager-didreceive-challenge-not/m-p/1380257#M7729</guid>
      <dc:creator>zdtorok</dc:creator>
      <dc:date>2024-02-09T12:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: authenticationManager didReceive challenge not working with previously received token</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/authenticationmanager-didreceive-challenge-not/m-p/1381362#M7730</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/763512"&gt;@zdtorok&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;I receive one challenge. challenge.remoteResource?.url is&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;A href="https://tiles.arcgis.com/tiles/B129y13w1XikjUdj/arcgis/rest/services/MyMapService/MapServer" target="_blank" rel="nofollow noopener noreferrer"&gt;https://tiles.arcgis.com/tiles/B129y13w1XikjUdj/arcgis/rest/services/MyMapService/MapServer&lt;/A&gt;&lt;/STRONG&gt;&lt;SPAN&gt;and challenge.request.url is &lt;/SPAN&gt;&lt;STRONG&gt;&lt;A href="https://www.arcgis.com/sharing/rest/generateToken" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.arcgis.com/sharing/rest/generateToken&lt;/A&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The challenge is issued for the portal (&lt;STRONG&gt;&lt;A href="https://www.arcgis.com/sharing/rest/generateToken" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.arcgis.com&lt;/A&gt;&lt;/STRONG&gt;) and the layer (&lt;STRONG&gt;&lt;A href="https://tiles.arcgis.com/tiles/B129y13w1XikjUdj/arcgis/rest/services/MyMapService/MapServer" target="_blank" rel="nofollow noopener noreferrer"&gt;https://tiles.arcgis.com/tiles/B129y13w1XikjUdj/arcgis/rest/services/MyMapService/MapServer&lt;/A&gt;&lt;/STRONG&gt;) is federated with the portal. The credential with token you are providing is the portal token. The following request creates a federated token with the token you have provided.&lt;/P&gt;&lt;PRE&gt; - [https://www.arcgis.com/sharing/rest/generateToken](https://www.arcgis.com/sharing/rest/generateToken?token=*****&amp;amp;serverUrl=https%3A%2F%2Ftiles.arcgis.com%2Ftiles&amp;amp;client=referer&amp;amp;referer=arcgisios&amp;amp;f=json)  
 - POST body:  
```
{
    client = referer;
    f = json;
    referer = arcgisios;
    serverUrl = "https://tiles.arcgis.com/tiles";
}
```  &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The layer is not accessible with the federated token and fails with an error.&lt;/P&gt;&lt;PRE&gt;{
  "error" : {
    "message" : "You do not have permissions to use this resource.",
    "details" : null,
    "code" : 403
  }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error for another layer seems to indicate the same that it is not accessible with the given token.&lt;/P&gt;&lt;PRE&gt;{
  "error" : {
    "code" : 403,
    "message" : "Subscription is disabled, the item is not accessible",
    "messageCode" : "SB_0005",
    "details" : [
      "Subscription is disabled, the item is not accessible"
    ]
  }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Another strange issue, can it happen that for the same user for the same resource with the same token handling, on iOS we receive an 403 error but on Android it works&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I doubt, but would like to see the side-by-side logs with actual token values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nimesh&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 23:28:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/authenticationmanager-didreceive-challenge-not/m-p/1381362#M7730</guid>
      <dc:creator>NimeshJarecha</dc:creator>
      <dc:date>2024-02-12T23:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: authenticationManager didReceive challenge not working with previously received token</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/authenticationmanager-didreceive-challenge-not/m-p/1382733#M7732</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1055"&gt;@NimeshJarecha&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you for your help. After checking it again it came out that I received wrong information and we have received 403 on both platform so there was no difference.&lt;/P&gt;&lt;P&gt;After we changed our test feature layer to one to which we actually had correct access and permissions set up, the whole flow seems working.&lt;/P&gt;&lt;P&gt;So, thanks for your help especially with the debug code you provided, that was very useful, without that we'd still be debugging without any hint on the 403 error.&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Zoltán&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2024 10:45:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/authenticationmanager-didreceive-challenge-not/m-p/1382733#M7732</guid>
      <dc:creator>zdtorok</dc:creator>
      <dc:date>2024-02-15T10:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: authenticationManager didReceive challenge not working with previously received token</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/authenticationmanager-didreceive-challenge-not/m-p/1382908#M7733</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/763512"&gt;@zdtorok&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm glad to hear that the issue has been resolved and that the flow is now working correctly. Thank you for letting me know and for your kind words.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nimesh&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2024 16:46:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/authenticationmanager-didreceive-challenge-not/m-p/1382908#M7733</guid>
      <dc:creator>NimeshJarecha</dc:creator>
      <dc:date>2024-02-15T16:46:32Z</dc:date>
    </item>
  </channel>
</rss>

