<?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: java httprequest arcgis server rest api longterm token in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/java-httprequest-arcgis-server-rest-api-longterm/m-p/44566#M3827</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right, I can change on server.&lt;/P&gt;&lt;P&gt;I've even tried 200 days :&lt;/P&gt;&lt;P&gt;For this I had to configure the server on 288.000 minutes on the short-live token,&lt;/P&gt;&lt;P&gt;implying to set 200 days too on the long-term part.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BUT, the client is supposed to fit the server configuration and not the opposit !&lt;/P&gt;&lt;P&gt;Which means that if we have a customer using an arcgis server configured with ONLY long live token (e.g. long live token set to 5 days, short-live token set to 0), the REST API seems not to be able to get any valid token.&lt;/P&gt;&lt;P&gt;It seems that in the ARCGis Server REST API there is no way to choose between long/short token types.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Mar 2016 10:19:54 GMT</pubDate>
    <dc:creator>ChristopheSCILLIERI</dc:creator>
    <dc:date>2016-03-04T10:19:54Z</dc:date>
    <item>
      <title>java httprequest arcgis server rest api longterm token</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/java-httprequest-arcgis-server-rest-api-longterm/m-p/44561#M3822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;We have a client javascript app that based on a java n-tier. &lt;/P&gt;&lt;P&gt;For layers security pupose, java part calls arcgis server via REST API to get an ident. token this way :&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;url = new URL( strUrl );&lt;/P&gt;&lt;P&gt;HttpURLConnection conn;&lt;/P&gt;&lt;P&gt;conn = (HttpURLConnection)url.openConnection();&lt;/P&gt;&lt;P&gt;conn.setRequestMethod( "POST" );&lt;/P&gt;&lt;P&gt;conn.setRequestProperty( "Accept-Charset", "UTF-8" );&lt;/P&gt;&lt;P&gt;conn.setRequestProperty( "Content-type", "application/x-www-form-urlencoded" );&lt;/P&gt;&lt;P&gt;conn.setRequestProperty( "Accept", "application/json" );&lt;/P&gt;&lt;P&gt;conn.setDoOutput( true );&lt;/P&gt;&lt;P&gt;conn.setDoInput( true );&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BufferedWriter bw = new BufferedWriter( new OutputStreamWriter( ( conn.getOutputStream() ), "UTF-8" ) );&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;String params = "username" + "=" + URLEncoder.encode( user, "UTF-8" ); params += "&amp;amp;";&lt;/P&gt;&lt;P&gt;params += "password" + "=" + URLEncoder.encode( pW, "UTF-8" ); params += "&amp;amp;";&lt;/P&gt;&lt;P&gt;params += "client" + "=" + URLEncoder.encode( "referer", "UTF-8" ); params += "&amp;amp;";&lt;/P&gt;&lt;P&gt;params += "referer" + "=" + URLEncoder.encode( referer, "UTF-8" ); params += "&amp;amp;";&lt;/P&gt;&lt;P&gt;params += "expiration" + "=" + URLEncoder.encode( duration, "UTF-8" ); params += "&amp;amp;";&lt;/P&gt;&lt;P&gt;params += "f" + "=" + URLEncoder.encode( "json", "UTF-8" );&lt;/P&gt;&lt;P&gt;bw.write( params ); bw.flush(); bw.close();&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if( conn.getResponseCode() == HttpURLConnection.HTTP_OK )&lt;/P&gt;&lt;P&gt;//here we go with the returned TOKEN&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We pass the returned token to the javascript client app which is init with a "esri.id.initialize(..)" and it works fine.&lt;/P&gt;&lt;P&gt;But it seems that in this way we only generate short-lived tokens.&lt;/P&gt;&lt;P&gt;How to generate long-live tokens with the arcgis server API REST ?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards.&lt;/P&gt;&lt;P&gt;Chris.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Feb 2016 17:18:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/java-httprequest-arcgis-server-rest-api-longterm/m-p/44561#M3822</guid>
      <dc:creator>ChristopheSCILLIERI</dc:creator>
      <dc:date>2016-02-23T17:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: java httprequest arcgis server rest api longterm token</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/java-httprequest-arcgis-server-rest-api-longterm/m-p/44562#M3823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm assuming duration is &amp;gt; 1 or two days.&lt;/P&gt;&lt;P&gt;Might be worth putting in a break point there and make sure you have the correct units. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Feb 2016 17:25:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/java-httprequest-arcgis-server-rest-api-longterm/m-p/44562#M3823</guid>
      <dc:creator>JordanBaumgardner</dc:creator>
      <dc:date>2016-02-23T17:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: java httprequest arcgis server rest api longterm token</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/java-httprequest-arcgis-server-rest-api-longterm/m-p/44563#M3824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, this code works fine. I set parameters : "username", "password", "client", "referer", and "expiration" in &lt;STRONG&gt;minutes&lt;/STRONG&gt;. I send the request to our arcgis server. And our server is returning a good usable short-term token, and a correct expiration date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the point is that I don't see anywhere to tell the server that I want a long-term token ?&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Feb 2016 08:26:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/java-httprequest-arcgis-server-rest-api-longterm/m-p/44563#M3824</guid>
      <dc:creator>ChristopheSCILLIERI</dc:creator>
      <dc:date>2016-02-24T08:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: java httprequest arcgis server rest api longterm token</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/java-httprequest-arcgis-server-rest-api-longterm/m-p/44564#M3825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So if you set Minutes = 600 (10 days) it doesn't work? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Feb 2016 17:03:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/java-httprequest-arcgis-server-rest-api-longterm/m-p/44564#M3825</guid>
      <dc:creator>JordanBaumgardner</dc:creator>
      <dc:date>2016-02-29T17:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: java httprequest arcgis server rest api longterm token</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/java-httprequest-arcgis-server-rest-api-longterm/m-p/44565#M3826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;would 10 days be 14400 minutes?&lt;/P&gt;&lt;P&gt;10d x 24h x 60m = 14400&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Feb 2016 17:12:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/java-httprequest-arcgis-server-rest-api-longterm/m-p/44565#M3826</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-02-29T17:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: java httprequest arcgis server rest api longterm token</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/java-httprequest-arcgis-server-rest-api-longterm/m-p/44566#M3827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right, I can change on server.&lt;/P&gt;&lt;P&gt;I've even tried 200 days :&lt;/P&gt;&lt;P&gt;For this I had to configure the server on 288.000 minutes on the short-live token,&lt;/P&gt;&lt;P&gt;implying to set 200 days too on the long-term part.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BUT, the client is supposed to fit the server configuration and not the opposit !&lt;/P&gt;&lt;P&gt;Which means that if we have a customer using an arcgis server configured with ONLY long live token (e.g. long live token set to 5 days, short-live token set to 0), the REST API seems not to be able to get any valid token.&lt;/P&gt;&lt;P&gt;It seems that in the ARCGis Server REST API there is no way to choose between long/short token types.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2016 10:19:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/java-httprequest-arcgis-server-rest-api-longterm/m-p/44566#M3827</guid>
      <dc:creator>ChristopheSCILLIERI</dc:creator>
      <dc:date>2016-03-04T10:19:54Z</dc:date>
    </item>
  </channel>
</rss>

