<?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: Tokens returned from Portal oauth2 are invalid for accessing hosted features through the REST API in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/tokens-returned-from-portal-oauth2-are-invalid-for/m-p/1237109#M4324</link>
    <description>&lt;P&gt;hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you manage to get this working?&lt;/P&gt;</description>
    <pubDate>Fri, 02 Dec 2022 03:38:49 GMT</pubDate>
    <dc:creator>RiddhiM</dc:creator>
    <dc:date>2022-12-02T03:38:49Z</dc:date>
    <item>
      <title>Tokens returned from Portal oauth2 are invalid for accessing hosted features through the REST API</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/tokens-returned-from-portal-oauth2-are-invalid-for/m-p/76486#M352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am attempting to authenticate a script to add features to a Portal hosted feature service through the REST API.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using oauth2 and the client credentials flow I am able to obtain a token from `&amp;lt;/portal/sharing/rest/oauth2/token&amp;gt;` by supplying the client id and client secret of a registered app, however when I attempt to use this token I get the following response:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;`'{"error":{"code":498,"message":"Invalid Token","details":[]}}'`&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used this method to authenticate with ArcGIS Online in the past but I can not get it to work with Portal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I am&lt;/EM&gt; able to obtain a valid token using the `&amp;lt;/sharing/rest/generateToken&amp;gt;` resource, but this requires me to use my username and password. I would prefer to use oauth2 and provide the App's client id/secret instead of having to provide user credentials.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I obtain a token from Portal through o&lt;SPAN&gt;auth2 that is valid for accessing hosted feature services&lt;/SPAN&gt;?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Aug 2018 17:00:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/tokens-returned-from-portal-oauth2-are-invalid-for/m-p/76486#M352</guid>
      <dc:creator>deleted-user--MMnVrog9xw_</dc:creator>
      <dc:date>2018-08-22T17:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Tokens returned from Portal oauth2 are invalid for accessing hosted features through the REST API</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/tokens-returned-from-portal-oauth2-are-invalid-for/m-p/1237109#M4324</link>
      <description>&lt;P&gt;hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you manage to get this working?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 03:38:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/tokens-returned-from-portal-oauth2-are-invalid-for/m-p/1237109#M4324</guid>
      <dc:creator>RiddhiM</dc:creator>
      <dc:date>2022-12-02T03:38:49Z</dc:date>
    </item>
  </channel>
</rss>

