<?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: How to use return OAuth Code to access protected feature class in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-return-oauth-code-to-access-protected/m-p/1252187#M80070</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/640976"&gt;@GraceTortorici_&lt;/a&gt;&amp;nbsp;-&lt;/P&gt;&lt;P&gt;OAuth works with the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html" target="_self"&gt;IdentityManager&lt;/A&gt;&amp;nbsp;provided by the SDK. These codes do not work like ArcGIS tokens where you can append them to a secure service's token parameter to gain access. More information on how OAuth works with ArcGIS in general can be found here:&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;&amp;nbsp;and JS SDK specific information on user logins with OAuth can be found here:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/secure-resources/#user-logins" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/secure-resources/#user-logins&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a tutorial on how to authenticate using an ArcGIS identity with the ArcGIS Maps SDK for JavaScript that shows you how to work with OAuth and set up the Identity Manager:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/authenticate-with-an-arcgis-identity/" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/authenticate-with-an-arcgis-identity/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
    <pubDate>Thu, 26 Jan 2023 23:36:14 GMT</pubDate>
    <dc:creator>LaurenBoyd</dc:creator>
    <dc:date>2023-01-26T23:36:14Z</dc:date>
    <item>
      <title>How to use return OAuth Code to access protected feature class</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-return-oauth-code-to-access-protected/m-p/1251962#M80065</link>
      <description>&lt;P&gt;We are running into issues passing the OAuth Code to access protected feature classes using the URL Parameter in the Feature Layer class in the ArcGIS GIS API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this an intended use of the OAuth code? Or should we be approaching this another way?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const layer = new FeatureLayer({
        url: "{{ URL_TO_FEATURE_SERVER }}/0?token={{ CODE_FROM_OAUTH}}",
      });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/6522"&gt;@JoelBennett&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/53756"&gt;@UndralBatsukh&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/507049"&gt;@Sage_Wall&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/400217"&gt;@LaurenBoyd&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/180"&gt;@AndyGup&lt;/a&gt;&amp;nbsp;Any insight is appreciated!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 17:45:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-return-oauth-code-to-access-protected/m-p/1251962#M80065</guid>
      <dc:creator>GraceTortorici_</dc:creator>
      <dc:date>2023-01-26T17:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to use return OAuth Code to access protected feature class</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-return-oauth-code-to-access-protected/m-p/1251972#M80066</link>
      <description>&lt;P&gt;I haven't used OAuth, so can't answer your questions directly. What I can tell you, though, is that the FeatureLayer constructor strips off the query string from the URL. To include query string parameters that go along with the service requests, you'll need to use &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#customParameters" target="_self"&gt;customParameters&lt;/A&gt; instead. For example:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const layer = new FeatureLayer({
	url: "https://server/arcgis/serviceName/FeatureServer/0",
	customParameters: {
		token: "CODE_FROM_OATH"
	}
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This would work until the token expires, and then the layer would stop working unless you refresh the token.&amp;nbsp; Perhaps a better solution would be to make use of &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerToken" target="_self"&gt;IdentityManager.registerToken&lt;/A&gt; instead.&amp;nbsp; This would automatically append the token to any service requests from the matching server path.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 18:01:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-return-oauth-code-to-access-protected/m-p/1251972#M80066</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-01-26T18:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to use return OAuth Code to access protected feature class</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-return-oauth-code-to-access-protected/m-p/1252187#M80070</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/640976"&gt;@GraceTortorici_&lt;/a&gt;&amp;nbsp;-&lt;/P&gt;&lt;P&gt;OAuth works with the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html" target="_self"&gt;IdentityManager&lt;/A&gt;&amp;nbsp;provided by the SDK. These codes do not work like ArcGIS tokens where you can append them to a secure service's token parameter to gain access. More information on how OAuth works with ArcGIS in general can be found here:&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;&amp;nbsp;and JS SDK specific information on user logins with OAuth can be found here:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/secure-resources/#user-logins" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/secure-resources/#user-logins&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a tutorial on how to authenticate using an ArcGIS identity with the ArcGIS Maps SDK for JavaScript that shows you how to work with OAuth and set up the Identity Manager:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/authenticate-with-an-arcgis-identity/" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/authenticate-with-an-arcgis-identity/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 23:36:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-return-oauth-code-to-access-protected/m-p/1252187#M80070</guid>
      <dc:creator>LaurenBoyd</dc:creator>
      <dc:date>2023-01-26T23:36:14Z</dc:date>
    </item>
  </channel>
</rss>

