<?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 Question about token in ArcGIS Enterprise Portal Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/question-about-token/m-p/434737#M5988</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working in federated environment. I created token from portal end:&amp;nbsp;'https://portal.domain.com/portal/sharing/rest/generateToken/'. Then clubbed the token with secured service's rest end using ?token=.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It came up something like this :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://undemo.ramtechgis.com/server/rest/services/Terminal_Testing/FeatureServer" title="https://undemo.ramtechgis.com/server/rest/services/Terminal_Testing/FeatureServer"&gt;https://gis.com/server/rest/services/Testing/FeatureServer&lt;/A&gt;&amp;nbsp;?token=aaaaaaaaaaaaaaaaaaaaavvvvvvvvvvvvvv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now when I try to open the link it ask me user name and password.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I follow&amp;nbsp; the same steps on non-federated environment. everything works fine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure why I am encountering this issue in federated env.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestion would be appreciated.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Sep 2019 05:58:45 GMT</pubDate>
    <dc:creator>ManviLather</dc:creator>
    <dc:date>2019-09-23T05:58:45Z</dc:date>
    <item>
      <title>Question about token</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/question-about-token/m-p/434737#M5988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working in federated environment. I created token from portal end:&amp;nbsp;'https://portal.domain.com/portal/sharing/rest/generateToken/'. Then clubbed the token with secured service's rest end using ?token=.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It came up something like this :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://undemo.ramtechgis.com/server/rest/services/Terminal_Testing/FeatureServer" title="https://undemo.ramtechgis.com/server/rest/services/Terminal_Testing/FeatureServer"&gt;https://gis.com/server/rest/services/Testing/FeatureServer&lt;/A&gt;&amp;nbsp;?token=aaaaaaaaaaaaaaaaaaaaavvvvvvvvvvvvvv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now when I try to open the link it ask me user name and password.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I follow&amp;nbsp; the same steps on non-federated environment. everything works fine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure why I am encountering this issue in federated env.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestion would be appreciated.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Sep 2019 05:58:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/question-about-token/m-p/434737#M5988</guid>
      <dc:creator>ManviLather</dc:creator>
      <dc:date>2019-09-23T05:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: Question about token</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/question-about-token/m-p/434738#M5989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How are you generating the token? Using a referer, requestIP, etc? If you're using a referer, you need to send the request with the referer as a header, which is not easily done simply in a browser without an add-in to modify/build the request.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Sep 2019 20:57:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/question-about-token/m-p/434738#M5989</guid>
      <dc:creator>JonathanQuinn</dc:creator>
      <dc:date>2019-09-23T20:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Question about token</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/question-about-token/m-p/434739#M5990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;1. How are you generating the token?&lt;/SPAN&gt;Using a referer, requestIP, etc?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--I am encountering this issue with all the three client option: http referer, IP , Request IP in federated env.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;When I am use the option "http referer", I provide the link of a monitoring app. Something like this :&amp;nbsp;&lt;A class="link-titled" href="https://app.test.com" title="https://app.test.com"&gt;https://app.test.com&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. If you're using a referer, you need to send the request with the referer as a header, which is not easily done simply in a browser without an add-in to modify/build the request ---- Could you please provide me some document on it ..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;Basically, I want to test secured services with token in a monitoring tool (Uptrends) to check if they are responding properly and then auto generate the task of token creation for the services in such a way that token gets automatically updated in the tool. I am still researching on the task.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Sep 2019 05:22:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/question-about-token/m-p/434739#M5990</guid>
      <dc:creator>ManviLather</dc:creator>
      <dc:date>2019-09-24T05:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Question about token</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/question-about-token/m-p/434740#M5991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you generate the token using &lt;A href="https://app.test.com,"&gt;https://app.test.com,&lt;/A&gt; do you send a request to the federated Server with the Referer header set to https://app.test.com?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Sep 2019 18:16:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/question-about-token/m-p/434740#M5991</guid>
      <dc:creator>JonathanQuinn</dc:creator>
      <dc:date>2019-09-24T18:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: Question about token</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/question-about-token/m-p/434741#M5992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am passing the parameters in Portal's generate window.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="460654" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/460654_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;To summarize,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. if I append token with service URL using &lt;STRONG&gt;?token,&lt;/STRONG&gt; browser asks me user name and password&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. if I append token with service URL &lt;STRONG&gt;&amp;amp;token,&lt;/STRONG&gt; following error comes up&lt;/P&gt;&lt;PRE style="color: #000000;"&gt;{"error":{"code":499,"message":"Token Required","details":[]}}&lt;/PRE&gt;&lt;P&gt;===========================================================&lt;/P&gt;&lt;P&gt;&amp;nbsp;During my research, I found the following script on geonet for using the referer option&amp;nbsp; :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand that by typing the request parameter in the URL, we use the HTTP GET method to obtain the token, however, ArcGIS REST API states that only HTTP POST method is allowed. So the server replies with an error. So for this case we have to use python or HTML etc. But what about the other two options&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import urllib, urllib2, json, ssl&lt;BR /&gt;username = "xyz"&lt;BR /&gt;password = "xyz"&lt;/P&gt;&lt;P&gt;tokenURL = 'https:testing/portal/sharing/rest/generateToken/'&lt;BR /&gt;params = {'f': 'pjson', 'username': username, 'password': password, 'referer': 'arcgis.com'}&lt;BR /&gt;req = urllib2.Request(tokenURL, urllib.urlencode(params))&lt;BR /&gt;try:&lt;BR /&gt; response = urllib2.urlopen(req)&lt;BR /&gt;except:&lt;BR /&gt; gcontext = ssl.SSLContext(ssl.PROTOCOL_TLSv1)&lt;BR /&gt; response = urllib2.urlopen(req, context=gcontext)&lt;BR /&gt;data = json.load(response)&lt;BR /&gt;token = data['token']&lt;BR /&gt;print(token)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The token generated workes fine when I append the token using &amp;amp;token=.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I need some clarification with IP and IP request option. What exactly I am missing? Why token created with these two options does not work in a federated environment?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestion would be appreciated.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Sep 2019 08:28:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/question-about-token/m-p/434741#M5992</guid>
      <dc:creator>ManviLather</dc:creator>
      <dc:date>2019-09-27T08:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: Question about token</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/question-about-token/m-p/434742#M5993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;They don't work because Server needs to validate the token via Portal. So:&lt;BR /&gt;&lt;BR /&gt;Your client machine:&lt;/P&gt;&lt;P&gt;&amp;nbsp; IP address 10.0.0.1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Server machine:&lt;/P&gt;&lt;P&gt;&amp;nbsp; IP address 10.0.0.3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Portal machine:&lt;/P&gt;&lt;P&gt;&amp;nbsp; IP address 10.0.0.3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you generate a token using your IP, Server will take that token and ask Portal to validate it, since Portal is controlling the security. The request that Portal receives is not from your machine, but from the Server machine, which has a different IP than your machine. Referrers are the recommended approach in a federated environment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Sep 2019 22:05:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/question-about-token/m-p/434742#M5993</guid>
      <dc:creator>JonathanQuinn</dc:creator>
      <dc:date>2019-09-27T22:05:06Z</dc:date>
    </item>
  </channel>
</rss>

