<?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 Native android ArcGIS(100.3.0) token authentication in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/native-android-arcgis-100-3-0-token-authentication/m-p/563743#M3830</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using arcGIS version 100.3.0 I'm trying to load points on arcGIS map from arcGIS server. I'm successfully able to do that but I'm not sure how to pass token to the arcGIS server with the URL_POINTS. Following is the code without passing token which I found from the documentation which is working fine.&lt;/P&gt;&lt;P&gt;My code snippet is&lt;/P&gt;&lt;P&gt;credential = UserCredential.createFromToken(gisToken, referer);&lt;/P&gt;&lt;P&gt;ServiceFeatureTable featureTablePolygons = new ServiceFeatureTable(Utilities.checkNull(polygonUrl));&lt;BR /&gt; featureTablePolygons.setCredential(credential);&lt;/P&gt;&lt;P&gt;QueryParameters query = new QueryParameters();&lt;BR /&gt; query.setWhereClause(queryString);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; //query feature from the table&lt;BR /&gt; final ListenableFuture&amp;lt;FeatureQueryResult&amp;gt; queryResultPolygons = featureTablePolygons.queryFeaturesAsync(query);&lt;BR /&gt; queryResultPolygons.addDoneListener(() -&amp;gt; {&lt;BR /&gt; try {&lt;BR /&gt; FeatureCollection featureCollection = new FeatureCollection();&lt;BR /&gt; FeatureQueryResult result = queryResultPolygons.get();&lt;BR /&gt; FeatureCollectionTable featureCollectionTable = new FeatureCollectionTable(result);&lt;BR /&gt; featureCollectionTable.setRenderer(new SimpleRenderer(new SimpleFillSymbol(SimpleFillSymbol.Style.SOLID, getResources().getColor(R.color.translucent_red), new SimpleLineSymbol(SimpleLineSymbol.Style.SOLID, Color.RED, 1))));&lt;BR /&gt; featureCollection.getTables().add(featureCollectionTable);&lt;BR /&gt; FeatureCollectionLayer featureCollectionLayer = new FeatureCollectionLayer(featureCollection);&lt;BR /&gt; mMapView.getMap().getOperationalLayers().add(featureCollectionLayer);&lt;/P&gt;&lt;P&gt;if (result.iterator().hasNext()) {&lt;BR /&gt; Feature feature = result.iterator().next();&lt;BR /&gt; Envelope envelope = feature.getGeometry().getExtent();&lt;BR /&gt; mMapView.setViewpointGeometryAsync(envelope);&lt;BR /&gt; } else {&lt;BR /&gt; // Toast.makeText(mContext, "No polygons found for " + queryString, Toast.LENGTH_SHORT).show();&lt;BR /&gt; }&lt;BR /&gt; } catch (InterruptedException | ExecutionException e) {&lt;BR /&gt; Log.e(TAG, "Error in FeatureQueryResult: " + e.getMessage());&lt;BR /&gt; }&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;STRONG style="text-decoration: underline;"&gt;Passing username and password works fine using below code&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;MyAuthenticatioChallengeHandler handler = new MyAuthenticatioChallengeHandler();&lt;BR /&gt; AuthenticationManager.setAuthenticationChallengeHandler(handler);&lt;BR /&gt;&lt;BR /&gt; class MyAuthenticatioChallengeHandler implements AuthenticationChallengeHandler {&lt;BR /&gt; private String USERNAME = "username";&lt;BR /&gt; private String USERPASSWORD = "password";&lt;/P&gt;&lt;P&gt;@Override&lt;BR /&gt; public AuthenticationChallengeResponse handleChallenge(AuthenticationChallenge authenticationChallenge) {&lt;BR /&gt; if (authenticationChallenge.getType() == AuthenticationChallenge.Type.USER_CREDENTIAL_CHALLENGE) {&lt;BR /&gt; return new AuthenticationChallengeResponse(&lt;BR /&gt; AuthenticationChallengeResponse.Action.CONTINUE_WITH_CREDENTIAL,&lt;BR /&gt; new UserCredential(USERNAME, USERPASSWORD));&lt;BR /&gt; } else {&lt;BR /&gt; Log.e(TAG, "USER CREDENTIAL challenge else");&lt;BR /&gt; return null;&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Nov 2018 07:21:21 GMT</pubDate>
    <dc:creator>manojkumar9</dc:creator>
    <dc:date>2018-11-05T07:21:21Z</dc:date>
    <item>
      <title>Native android ArcGIS(100.3.0) token authentication</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/native-android-arcgis-100-3-0-token-authentication/m-p/563743#M3830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using arcGIS version 100.3.0 I'm trying to load points on arcGIS map from arcGIS server. I'm successfully able to do that but I'm not sure how to pass token to the arcGIS server with the URL_POINTS. Following is the code without passing token which I found from the documentation which is working fine.&lt;/P&gt;&lt;P&gt;My code snippet is&lt;/P&gt;&lt;P&gt;credential = UserCredential.createFromToken(gisToken, referer);&lt;/P&gt;&lt;P&gt;ServiceFeatureTable featureTablePolygons = new ServiceFeatureTable(Utilities.checkNull(polygonUrl));&lt;BR /&gt; featureTablePolygons.setCredential(credential);&lt;/P&gt;&lt;P&gt;QueryParameters query = new QueryParameters();&lt;BR /&gt; query.setWhereClause(queryString);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; //query feature from the table&lt;BR /&gt; final ListenableFuture&amp;lt;FeatureQueryResult&amp;gt; queryResultPolygons = featureTablePolygons.queryFeaturesAsync(query);&lt;BR /&gt; queryResultPolygons.addDoneListener(() -&amp;gt; {&lt;BR /&gt; try {&lt;BR /&gt; FeatureCollection featureCollection = new FeatureCollection();&lt;BR /&gt; FeatureQueryResult result = queryResultPolygons.get();&lt;BR /&gt; FeatureCollectionTable featureCollectionTable = new FeatureCollectionTable(result);&lt;BR /&gt; featureCollectionTable.setRenderer(new SimpleRenderer(new SimpleFillSymbol(SimpleFillSymbol.Style.SOLID, getResources().getColor(R.color.translucent_red), new SimpleLineSymbol(SimpleLineSymbol.Style.SOLID, Color.RED, 1))));&lt;BR /&gt; featureCollection.getTables().add(featureCollectionTable);&lt;BR /&gt; FeatureCollectionLayer featureCollectionLayer = new FeatureCollectionLayer(featureCollection);&lt;BR /&gt; mMapView.getMap().getOperationalLayers().add(featureCollectionLayer);&lt;/P&gt;&lt;P&gt;if (result.iterator().hasNext()) {&lt;BR /&gt; Feature feature = result.iterator().next();&lt;BR /&gt; Envelope envelope = feature.getGeometry().getExtent();&lt;BR /&gt; mMapView.setViewpointGeometryAsync(envelope);&lt;BR /&gt; } else {&lt;BR /&gt; // Toast.makeText(mContext, "No polygons found for " + queryString, Toast.LENGTH_SHORT).show();&lt;BR /&gt; }&lt;BR /&gt; } catch (InterruptedException | ExecutionException e) {&lt;BR /&gt; Log.e(TAG, "Error in FeatureQueryResult: " + e.getMessage());&lt;BR /&gt; }&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;STRONG style="text-decoration: underline;"&gt;Passing username and password works fine using below code&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;MyAuthenticatioChallengeHandler handler = new MyAuthenticatioChallengeHandler();&lt;BR /&gt; AuthenticationManager.setAuthenticationChallengeHandler(handler);&lt;BR /&gt;&lt;BR /&gt; class MyAuthenticatioChallengeHandler implements AuthenticationChallengeHandler {&lt;BR /&gt; private String USERNAME = "username";&lt;BR /&gt; private String USERPASSWORD = "password";&lt;/P&gt;&lt;P&gt;@Override&lt;BR /&gt; public AuthenticationChallengeResponse handleChallenge(AuthenticationChallenge authenticationChallenge) {&lt;BR /&gt; if (authenticationChallenge.getType() == AuthenticationChallenge.Type.USER_CREDENTIAL_CHALLENGE) {&lt;BR /&gt; return new AuthenticationChallengeResponse(&lt;BR /&gt; AuthenticationChallengeResponse.Action.CONTINUE_WITH_CREDENTIAL,&lt;BR /&gt; new UserCredential(USERNAME, USERPASSWORD));&lt;BR /&gt; } else {&lt;BR /&gt; Log.e(TAG, "USER CREDENTIAL challenge else");&lt;BR /&gt; return null;&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2018 07:21:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/native-android-arcgis-100-3-0-token-authentication/m-p/563743#M3830</guid>
      <dc:creator>manojkumar9</dc:creator>
      <dc:date>2018-11-05T07:21:21Z</dc:date>
    </item>
  </channel>
</rss>

