<?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: IdentityManager gets bad tokens in ArcGIS Runtime SDK for WPF (Retired) Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/identitymanager-gets-bad-tokens/m-p/684355#M3491</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your reply.&amp;nbsp; We are setting the challenge method to progammatically generate the token.&amp;nbsp; So the token requests should be identical every time, and not for a different user.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I did try to set the referrer like you mention.&amp;nbsp; I saw some interesting results.&amp;nbsp; Without setting the referrer, there are always 2 token requests when obtaining a token.&amp;nbsp; The first fails saying Referrer must be specified.&amp;nbsp; Then IdentityManager must recognize that and it adds Client=requestip, which gets the token.&amp;nbsp; However, it does fail 25-50% of the time on that second request too.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With the referrer set, we only get 1 token request, because the first request has client=referrer and referrer=arcgis.com in the request.&amp;nbsp; I tried 20+ times and I never got the failure I've been seeing, so this seems very promising.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I will do some more testing, but this seems to be a good work-around.&amp;nbsp; One last question - What is the recommended value for referrer since this isn't a web-based application we're using?&amp;nbsp; I didn't get a solid feel for that based on the API documentation.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Jun 2013 14:56:21 GMT</pubDate>
    <dc:creator>BrianRassier</dc:creator>
    <dc:date>2013-06-14T14:56:21Z</dc:date>
    <item>
      <title>IdentityManager gets bad tokens</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/identitymanager-gets-bad-tokens/m-p/684353#M3489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We're using IdentityManager to access secure ArcGIS Online services.&amp;nbsp; About 50% of the time this works as expected:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;a) We access the service&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;b) A "499 Token Required" response is obtained&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;c) IdentityManager triggers a token request&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;d) The token is appended on the original request&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;e) Service access is granted&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, the other 50% of the time we get a series of "&lt;/SPAN&gt;&lt;STRONG&gt;403 You do not have permissions to use this resource&lt;/STRONG&gt;&lt;SPAN&gt;" errors.&amp;nbsp; These happen in response to step d) above.&amp;nbsp; Then a new token is requested, and we continue looping through this process until we successfully get to the service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Occasinally it takes 2-4 token requests before we finally get access to the service.&amp;nbsp; The troublesome part is, sometimes we seem to get in a loop that never ends.&amp;nbsp; We've seen 20-30 failed requests before we kill our app.&amp;nbsp; This has happened a few times today alone.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone seen this?&amp;nbsp; Any insight into why it's happening?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2013 16:48:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/identitymanager-gets-bad-tokens/m-p/684353#M3489</guid>
      <dc:creator>BrianRassier</dc:creator>
      <dc:date>2013-06-11T16:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: IdentityManager gets bad tokens</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/identitymanager-gets-bad-tokens/m-p/684354#M3490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What kind of Challenge method did you set? Is it a challenge method that generates a token progammatically or is there an UI? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From your description, it looks as if a token was generated automatically by the challenge method but for a wrong user.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In this case, the IM gets in a loop to give a chance to the user or to the program behind the challenge method to log in with the right user.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However the loop is limited to 20 tentatives then the request fails (as if the user cancelled the sign in dialog).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note: if not already done, we can try to set a referer for the token generation. Something like IdentityManager.Current.TokenGenerationReferer = "arcgis.com". Though, that should not explain the error you reported.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 18:33:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/identitymanager-gets-bad-tokens/m-p/684354#M3490</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2013-06-13T18:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: IdentityManager gets bad tokens</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/identitymanager-gets-bad-tokens/m-p/684355#M3491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your reply.&amp;nbsp; We are setting the challenge method to progammatically generate the token.&amp;nbsp; So the token requests should be identical every time, and not for a different user.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I did try to set the referrer like you mention.&amp;nbsp; I saw some interesting results.&amp;nbsp; Without setting the referrer, there are always 2 token requests when obtaining a token.&amp;nbsp; The first fails saying Referrer must be specified.&amp;nbsp; Then IdentityManager must recognize that and it adds Client=requestip, which gets the token.&amp;nbsp; However, it does fail 25-50% of the time on that second request too.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With the referrer set, we only get 1 token request, because the first request has client=referrer and referrer=arcgis.com in the request.&amp;nbsp; I tried 20+ times and I never got the failure I've been seeing, so this seems very promising.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I will do some more testing, but this seems to be a good work-around.&amp;nbsp; One last question - What is the recommended value for referrer since this isn't a web-based application we're using?&amp;nbsp; I didn't get a solid feel for that based on the API documentation.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jun 2013 14:56:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/identitymanager-gets-bad-tokens/m-p/684355#M3491</guid>
      <dc:creator>BrianRassier</dc:creator>
      <dc:date>2013-06-14T14:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: IdentityManager gets bad tokens</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/identitymanager-gets-bad-tokens/m-p/684356#M3492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Without setting the referrer, there are always 2 token requests when obtaining a token.&amp;nbsp; The first fails saying Referrer must be specified.&amp;nbsp; Then IdentityManager must recognize that and it adds Client=requestip, which gets the token.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's normal. If there is no default referer, we first try to generate a token without any option i.e a short lived token. But arcgis.com doesn't support short lived token yet. So we catch the error and try to generate a token for the current IP.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;However, it does fail 25-50% of the time on that second request too.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Interesting. I never observed this case. Might be due to your firewall config and an arcgis.Com change I never noticed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, it's a good practice to use a referer with OnPremise and OnLine portals in order to avoid issues.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; With the referrer set, we only get 1 token request, because the first request has client=referrer and referrer=arcgis.com in the request. I tried 20+ times and I never got the failure I've been seeing, so this seems very promising.&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Great &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;What is the recommended value for referrer since this isn't a web-based application we're using? I didn't get a solid feel for that based on the API documentation.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With the WPF API (unlike Silverlight and WinPhone API) you can use the referrer you want (e.g your application name).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Once a token has been generated for a specific referer, the Identity Manager will automatically add the referrer as header of the requests that need the token (you should be able to observe that with fiddler).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jun 2013 15:19:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/identitymanager-gets-bad-tokens/m-p/684356#M3492</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2013-06-14T15:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: IdentityManager gets bad tokens</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/identitymanager-gets-bad-tokens/m-p/684357#M3493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks again for this insight.&amp;nbsp; Things are looking good with these adjustments so far.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jun 2013 15:25:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/identitymanager-gets-bad-tokens/m-p/684357#M3493</guid>
      <dc:creator>BrianRassier</dc:creator>
      <dc:date>2013-06-14T15:25:55Z</dc:date>
    </item>
  </channel>
</rss>

