<?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: Secured Feature Service Authentication -Example in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/secured-feature-service-authentication-example/m-p/1069400#M3890</link>
    <description>&lt;P&gt;For the Oath piece, have you looked the documentation?&amp;nbsp;&amp;nbsp;&lt;A href="https://developers.arcgis.com/documentation/mapping-apis-and-services/security/oauth-2.0/" target="_blank"&gt;https://developers.arcgis.com/documentation/mapping-apis-and-services/security/oauth-2.0/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Jun 2021 15:01:30 GMT</pubDate>
    <dc:creator>John_Spence</dc:creator>
    <dc:date>2021-06-17T15:01:30Z</dc:date>
    <item>
      <title>Secured Feature Service Authentication -Example</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/secured-feature-service-authentication-example/m-p/1069186#M3885</link>
      <description>&lt;P&gt;I am wondering whether any of you have a sample of creating a login for a Secured Feature Service in a Federated Server authenticated through portal? The examples provided are authenticating thru' arcgis.com and not giving an option for ArcGIS Enterprise. I a newbie- please ignore my starting trouble.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 01:58:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/secured-feature-service-authentication-example/m-p/1069186#M3885</guid>
      <dc:creator>AnnCrystal</dc:creator>
      <dc:date>2021-06-17T01:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: Secured Feature Service Authentication -Example</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/secured-feature-service-authentication-example/m-p/1069350#M3886</link>
      <description>&lt;P&gt;Are you just trying to lift the data through the API or are you trying to make it so a user does not have to log into a secured service when using a map product?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 14:10:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/secured-feature-service-authentication-example/m-p/1069350#M3886</guid>
      <dc:creator>John_Spence</dc:creator>
      <dc:date>2021-06-17T14:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: Secured Feature Service Authentication -Example</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/secured-feature-service-authentication-example/m-p/1069370#M3887</link>
      <description>&lt;P&gt;What I am trying to accomplish is - edit a secured Feature table published as a featureservice in a federated server. Normally when you load a secured featureservice, it will prompt for user credentials.&lt;/P&gt;&lt;P&gt;So, what I am trying to do is authenticate it first and then pass the credentials to that feature service (remember the session) and perform add/edit/update etc on that feature table.&lt;/P&gt;&lt;P&gt;The Oauth2 example shows how to authenticate through ArcGIS.com which doesn't give an option to switch the login to ArcGIS enterprise. If you have an example to accomplish this- that would be great. I though this is a common scenario which everybody come across to do a basic CRUD operation against a feature layer/table. But, stuck on where to start &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp; without a sample.&amp;nbsp;&lt;BR /&gt;Also, please suggest some learning recommendations too. Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 14:32:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/secured-feature-service-authentication-example/m-p/1069370#M3887</guid>
      <dc:creator>AnnCrystal</dc:creator>
      <dc:date>2021-06-17T14:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: Secured Feature Service Authentication -Example</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/secured-feature-service-authentication-example/m-p/1069377#M3888</link>
      <description>&lt;P&gt;I am assuming you are doing this outside of Pro, Desktop or a Web Application Builder type app and directly inserting via API.&lt;/P&gt;&lt;P&gt;Python example:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;def get_token():&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;BR /&gt;# Name: Function -&lt;BR /&gt;# Purpose:&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;data = checklist.b64decode(AGOL_Pass)&lt;BR /&gt;pw = data.decode("ascii")&lt;/P&gt;&lt;P&gt;url = '&lt;A href="https://www.arcgis.com/sharing/rest/generateToken" target="_blank"&gt;https://www.arcgis.com/sharing/rest/generateToken&lt;/A&gt;'&lt;BR /&gt;values = {'f': 'json',&lt;BR /&gt;'username': AGOL_User,&lt;BR /&gt;'password': pw,&lt;BR /&gt;'referer' : '&lt;A href="https://www.arcgis.com" target="_blank"&gt;https://www.arcgis.com&lt;/A&gt;',&lt;BR /&gt;'expiration' : '10'}&lt;/P&gt;&lt;P&gt;data = urllib.parse.urlencode(values).encode("utf-8")&lt;BR /&gt;req = urllib.request.Request(url)&lt;/P&gt;&lt;P&gt;response = None&lt;BR /&gt;while response is None:&lt;BR /&gt;try:&lt;BR /&gt;response = urllib.request.urlopen(req,data=data)&lt;BR /&gt;except:&lt;BR /&gt;pass&lt;/P&gt;&lt;P&gt;the_page = response.read()&lt;/P&gt;&lt;P&gt;#Garbage Collection with some house building&lt;BR /&gt;payload_json = the_page.decode('utf8')&lt;BR /&gt;payload_json = json.loads(payload_json)&lt;/P&gt;&lt;P&gt;edit_token = payload_json['token']&lt;/P&gt;&lt;P&gt;return (edit_token)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;If you are trying to do this through a web app as an example though, you can take the route of getting a long term token.&amp;nbsp; In this case though, there are some perils involved depending on how you configure things.&amp;nbsp; You would tack on&amp;nbsp;?token={}, {} being the token you would insert for the service.&amp;nbsp; This would allow you to use a Portal account as authentication for that feature service.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 14:39:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/secured-feature-service-authentication-example/m-p/1069377#M3888</guid>
      <dc:creator>John_Spence</dc:creator>
      <dc:date>2021-06-17T14:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Secured Feature Service Authentication -Example</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/secured-feature-service-authentication-example/m-p/1069380#M3889</link>
      <description>&lt;P&gt;Oh!!! The URL for the portal token you may need is here:&amp;nbsp;&amp;nbsp;&lt;A href="https://yourserver.com/webadaptorname/admin/login" target="_blank" rel="noopener"&gt;https://yourserver.com/webadaptorname/admin/login&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I am assuming you are going to use the Portal server in that URL and portal web adaptor name.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 14:41:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/secured-feature-service-authentication-example/m-p/1069380#M3889</guid>
      <dc:creator>John_Spence</dc:creator>
      <dc:date>2021-06-17T14:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: Secured Feature Service Authentication -Example</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/secured-feature-service-authentication-example/m-p/1069400#M3890</link>
      <description>&lt;P&gt;For the Oath piece, have you looked the documentation?&amp;nbsp;&amp;nbsp;&lt;A href="https://developers.arcgis.com/documentation/mapping-apis-and-services/security/oauth-2.0/" target="_blank"&gt;https://developers.arcgis.com/documentation/mapping-apis-and-services/security/oauth-2.0/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 15:01:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/secured-feature-service-authentication-example/m-p/1069400#M3890</guid>
      <dc:creator>John_Spence</dc:creator>
      <dc:date>2021-06-17T15:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: Secured Feature Service Authentication -Example</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/secured-feature-service-authentication-example/m-p/1069455#M3891</link>
      <description>&lt;P&gt;Thank you very much! Yes, I looked into Oauth jsapi one- confused with how to get it to work in Enterprise. I am sorry, I should have mentioned how I was trying to achieve it. I am trying to put together a basic web app- through javascript. The python example is great- by any chance- do you have a javascript example?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 16:00:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/secured-feature-service-authentication-example/m-p/1069455#M3891</guid>
      <dc:creator>AnnCrystal</dc:creator>
      <dc:date>2021-06-17T16:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Secured Feature Service Authentication -Example</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/secured-feature-service-authentication-example/m-p/1069560#M3892</link>
      <description>&lt;P&gt;Here is the reference --&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/3/jssamples/portal_oauth_inline.html" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/3/jssamples/portal_oauth_inline.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 19:54:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/secured-feature-service-authentication-example/m-p/1069560#M3892</guid>
      <dc:creator>John_Spence</dc:creator>
      <dc:date>2021-06-17T19:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: Secured Feature Service Authentication -Example</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/secured-feature-service-authentication-example/m-p/1069666#M3893</link>
      <description>&lt;P&gt;Awesome- I could sign into portal. How can I pass that credential to a secured map service layer?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jun 2021 02:13:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/secured-feature-service-authentication-example/m-p/1069666#M3893</guid>
      <dc:creator>AnnCrystal</dc:creator>
      <dc:date>2021-06-18T02:13:20Z</dc:date>
    </item>
  </channel>
</rss>

