<?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: Token authentication in 100.0.0 in Java Maps SDK Questions</title>
    <link>https://community.esri.com/t5/java-maps-sdk-questions/token-authentication-in-100-0-0/m-p/730402#M2195</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ok, I see what you are getting at. Well, I am not aware of such possibility in ArcGIS Runitme 100.0.0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can generate valid token at the &lt;A _jive_internal="true" href="https://community.esri.com/thread/&amp;quot;https:/www.arcgis.com/sharing/generateToken"&gt;ArcGIS Online service endpoint&lt;/A&gt; , but you need to somehow handle its refreshing and appending to ArcGIS Server endpoint requests, which in fact UserCredentials do for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adm&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 18 Mar 2017 17:19:40 GMT</pubDate>
    <dc:creator>nita14</dc:creator>
    <dc:date>2017-03-18T17:19:40Z</dc:date>
    <item>
      <title>Token authentication in 100.0.0</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/token-authentication-in-100-0-0/m-p/730399#M2192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I try to make calls to a &lt;SPAN style="color: #333333; background-color: #ffffff;"&gt;token-secured&amp;nbsp;&lt;/SPAN&gt;RemoteResource using the new 100.0.0 API, I get an exception:&lt;BR /&gt;"com.esri.arcgisruntime.io.JsonEmbeddedException: Token Required"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to add a Token to a UserCredentials object? In the 10.2.4, I would create a UserCredentials object, and simply call setUserToken(), but that method no longer exists. In the new API, the UserCredentials class only takes a username and a password. There is another type of Credential, OAuthTokenCredential, but this is not appropriate to my use case because I'm not using OAuth.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How is non-OAuth token-based authentication handled in the new API?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2017 18:35:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/token-authentication-in-100-0-0/m-p/730399#M2192</guid>
      <dc:creator>DavidMomper</dc:creator>
      <dc:date>2017-03-16T18:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: Token authentication in 100.0.0</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/token-authentication-in-100-0-0/m-p/730400#M2193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look at the snippet below.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;ArcGISMapImageLayer trafficLayer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;ArcGISMapImageLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;url&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
trafficLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setId&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"TrafficLayer"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
trafficLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setCredential&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;UserCredential&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"ArcGISOnlineUserNameCaseSensitive"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"password"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:11:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/token-authentication-in-100-0-0/m-p/730400#M2193</guid>
      <dc:creator>nita14</dc:creator>
      <dc:date>2021-12-12T07:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Token authentication in 100.0.0</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/token-authentication-in-100-0-0/m-p/730401#M2194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's not what I'm looking for. That's just username and password. I need a way to handle token-based authentication, as described here:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/authentication/" title="https://developers.arcgis.com/authentication/"&gt;ArcGIS Security and Authentication | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;STRONG style="color: #4c4c4c; font-weight: 500;"&gt;Token-based&lt;/STRONG&gt;&lt;SPAN style="color: #4c4c4c;"&gt;: Your app provides a valid user name and password for the user. In the response, you receive a token that is included with requests for secured content on the portal for authenticated resources. Available with &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/arcgis-rest-api/#/Generate_Token/02r3000000m5000000/" style="color: #0079c1;"&gt;ArcGIS Online&lt;/A&gt;&lt;SPAN style="color: #4c4c4c;"&gt; and &lt;/SPAN&gt;&lt;A href="http://www.esri.com/software/arcgis/arcgisserver" style="color: #0079c1;"&gt;ArcGIS Enterprise&lt;/A&gt;&lt;SPAN style="color: #4c4c4c;"&gt; version 10.2 or earlier.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The UserCredential class can only store a username and password, not a token. Specifically what I'm looking for is:&lt;/P&gt;&lt;P&gt;1. How to connect to a &lt;A href="http://resources.arcgis.com/en/help/server-admin-api/generateToken.html"&gt;token generation&lt;/A&gt; service to obtain a token? Is there anything like&amp;nbsp;&lt;A href="https://developers.arcgis.com/java/latest/api-reference/reference/com/esri/arcgisruntime/security/OAuthTokenCredentialRequest.html"&gt;OAuthTokenCredentialRequest&lt;/A&gt; that will work for&amp;nbsp;non-OAuth token generation?&lt;/P&gt;&lt;P&gt;2. Once I have a valid token, how to use the token to authenticate with a RemoteResource? Maybe a subclass of Credential that can store a token, so I can return it from my &lt;A href="https://developers.arcgis.com/java/latest/api-reference/reference/com/esri/arcgisruntime/security/AuthenticationChallengeHandler.html"&gt;AuthenticationChallengeHandler&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Mar 2017 14:25:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/token-authentication-in-100-0-0/m-p/730401#M2194</guid>
      <dc:creator>DavidMomper</dc:creator>
      <dc:date>2017-03-17T14:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: Token authentication in 100.0.0</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/token-authentication-in-100-0-0/m-p/730402#M2195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ok, I see what you are getting at. Well, I am not aware of such possibility in ArcGIS Runitme 100.0.0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can generate valid token at the &lt;A _jive_internal="true" href="https://community.esri.com/thread/&amp;quot;https:/www.arcgis.com/sharing/generateToken"&gt;ArcGIS Online service endpoint&lt;/A&gt; , but you need to somehow handle its refreshing and appending to ArcGIS Server endpoint requests, which in fact UserCredentials do for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adm&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Mar 2017 17:19:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/token-authentication-in-100-0-0/m-p/730402#M2195</guid>
      <dc:creator>nita14</dc:creator>
      <dc:date>2017-03-18T17:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: Token authentication in 100.0.0</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/token-authentication-in-100-0-0/m-p/730403#M2196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Adam Nicinski wrote:&lt;/P&gt;&lt;P&gt;You can generate valid token at the &lt;A _jive_internal="true" href="https://community.esri.com/thread/&amp;quot;https:/www.arcgis.com/sharing/generateToken"&gt;ArcGIS Online service endpoint&lt;/A&gt; , but you need to somehow handle its refreshing and appending to ArcGIS Server endpoint requests, which in fact UserCredentials do for you.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Can you please elaborate on how UserCredentials does this? I can't find any way to&amp;nbsp;get a UserCredentials to handle tokens; if you know a way to do this, can you please post a few lines of code to demonstrate how it works?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Mar 2017 16:07:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/token-authentication-in-100-0-0/m-p/730403#M2196</guid>
      <dc:creator>DavidMomper</dc:creator>
      <dc:date>2017-03-20T16:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: Token authentication in 100.0.0</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/token-authentication-in-100-0-0/m-p/730404#M2197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want to say is just that UserCredentials creates and refershes tokens automatically for you on the valid generateToken endpoint.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can only quote the docs:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;H2 style="background-color: #ffffff; border-width: 2px 0px 0px; border-style: solid initial initial initial; border-color: #cccccc initial initial initial; font-size: 1.45em; margin: 2em 0px 1em; padding: 0.5em 0px 0px;"&gt;Class Overview&lt;/H2&gt;&lt;P style="color: #333333; background-color: #ffffff; border: 0px; margin: 0px 0px 1em;"&gt;Represents a named user credential. User credentials will be used to authenticate against HTTP-secured services, and to generate tokens for authenticating token-secured services.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Mar 2017 07:17:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/token-authentication-in-100-0-0/m-p/730404#M2197</guid>
      <dc:creator>nita14</dc:creator>
      <dc:date>2017-03-21T07:17:39Z</dc:date>
    </item>
  </channel>
</rss>

