I'm using Arcgis Java SDK 10.2.4 and developing desktop application.
During development we're using feature services without any authentication and now we're secured them with username and password.
But secured feature layer access is denied sometimes, says "Unauthorized access to a secure service" even though password is correct. We're able to login through web with the same username and password and query features works.
We're creating user credentials following code:
UserCredentials userCredentials <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">UserCredentials</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
userCredentials<SPAN class="punctuation token">.</SPAN><SPAN class="token function">setUserAccount</SPAN><SPAN class="punctuation token">(</SPAN>defaultArcgisUsername<SPAN class="punctuation token">,</SPAN> defaultArcgisPassword<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">final</SPAN> GeodatabaseFeatureServiceTable fsTable <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">GeodatabaseFeatureServiceTable</SPAN><SPAN class="punctuation token">(</SPAN>layerData<SPAN class="punctuation token">.</SPAN><SPAN class="token function">getFullUrl</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> userCredentials<SPAN class="punctuation token">,</SPAN> layerData<SPAN class="punctuation token">.</SPAN><SPAN class="token function">getLayerIndex</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Our feature service is running with self signed certificate and we've set custom trust store which has the feature service certificate.
Any things to check?