You need to sign in to do that
Don't have an account?
Dallas Kuhn
java.io.IOException: No authentication challenges found
I am using the latest SalesforceMobileSDK (3.0) to build native Android apps. I use single sign-on and get a new restClient every time my main activity has resumed.
I have these three scopes on the connected app and in my bootConfig:
@Override public void onResume(RestClient client) { restClient = client; }When I try use the restClient a day after the initial login (and after the initial authToken expired)
private void sendRequest(String soql) throws UnsupportedEncodingException { RestRequest restRequest = RestRequest.getRequestForQuery(getString(R.string.api_version), soql); restClient.sendAsync(restRequest, new RestClient.AsyncRequestCallback() { @Override public void onSuccess(RestRequest request, RestResponse result) { //process results here... } @Override public void onError(Exception exception) { Toast.makeText(MainActivity.this, MainActivity.this.getString(SalesforceSDKManager.getInstance().getSalesforceR().stringGenericError(), exception.toString()), Toast.LENGTH_LONG).show(); } }); }I get an 'java.io.IOException: No authentication challenges found'. This is all basic stuff and I never got this error with the previous SDK (2.0) using the same code above. After some searching I have discovered that this is caused by an unauthorized response from the server (Salesforce) but I have verified that I am correctly sending the new auth token with the request that i received back from Salesforce in my onResume method.
I have these three scopes on the connected app and in my bootConfig:
<string-array name="oauthScopes"> <item>api</item> <item>web</item> <item>refresh_token</item> </string-array>I am using a Samsung Galaxy S5 running Android 4.4.2 if that info helps. Is someone able to tell me why i get this and more imortantly how to fix it?
A similar issue has been reported by another developer in our SDK community and it will be great if you can help me reproduce the issue: https://plus.google.com/u/0/104482801595232431809/posts/1Lb6oCNbUTu
To create new sample project: To build the project: To install on the device: The full toast error is as follows:
I have not been successful in reproducing this issue on the emulators and I still trying with a Samsung galaxy device. Have you also tried with the emulator? Does this issue happen for you at both places (device and emulator)?
I'm sorry to hook in to a discussion like this, being a complete stranger to all of you, but I have experienced this very behaviour (and Java Exception stack) in other areas. In my case (completely isolated from SalesForce) it turned out that the server side API was sending a 401 without passing along a proper WWW-Authenticate header. Since the header is required by standard (http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html), the Android HttpURLConnection was forced to throw an IOException with the message "No authentication challenges found" because of the faulty header.
I could mainly see this on JellyBean Android platforms. This link (https://android.googlesource.com/platform/libcore/+/android-4.1.2_r1/luni/src/main/java/libcore/net/http/HttpURLConnectionImpl.java) would point to the Android 4.1 implementation of said http connection.
I could fix my issue by correcting the server side API to also include a standards compliant header, but I still see the issue on Samsung Galaxy S3 devices (still only on JellyBean Androids 4.1 - 4.3). Now I don't know if the issue is due to an alternative Samsung Android implementation or due to a majority of my userbase being located in a geographic area where headers are removed by governments or Internet providers. I am yet to find a good solution for those devices, meanwhile having a ugly "if (samsung)" test in my code.
I hope I could bring something useful to the discussion.
Dallas, is this still an issues?
I have been working on another app (non SF) so i am not entirely sure if it's still happening. I will run the app on a device and emulator and I will verify tomorrow as to whether this is still happening or not.
So I updated to the latest version of the MobileSDK (3.1.1) and created a new test app using the same steps listed above. I then installed the test app on a LG Nexus 5 (Android 5.0.2), Sony Z2 (Android 4.4.4), Samsung Note 10.1" (Android 4.4.2), HTC M8 (Android 4.4.4), Samsung Ace 3 (Android 4.2.2). I logged in with my SF credentials on each device and then closed the app. Upon returning to the app 24 hours later on each device and requesting data from SF, all devices returned the data except for the Samsung Ace 3, which gave the error 'java.io.IOException: No authentication challenges found'.
This may or may not be of help to someone else, I thought it interesting that it's device-specific. Previously it was on a Samsung Galaxy S5, now on a Samsung Ace 3 - the other devices were fine.
Lenovo B8000-H
Versione android: 4.2.2
Galay Tab 10.1 2014
Codice Modello SM-T335
Versione android: 4.4.2
Galaxy Tab 4
Codice modello:SM-P605
Versione Android: 4.3
The Salesforce SDK version is:
android:versionCode="40"
android:versionName="3.1.0"
And finally, this is the error log:
Can you provide us some workaround?
We have also seen the same issue in tha ALCATEL ONE TOUCH Fierce ,Strange thing is even after we re login the issue continues to exist for couple of hours and then its works as if its normal..
Current SDK version we are using is 3.1.1 and its the same with the sample apps on this phone.
we can reproduce this issue by revoking the session and restarting the phone .or restart the phone revoke the session and open the app
Seven months later I am still receiving reports from my users complaining about this issue. Can anyone from SF provide a solution oto this or perhaps know the root cause?
I am using the latest SF MobileSDK (3.2.1) and minSdkVersion 18 for Android.
From what I can tell SF should be returning a 'WWW-Authenticate' header but is not. Can we make that happen somewhow?
I am using salesforce SDK version 3.3.0(44) and minSdkVersion 14 for Android.Its still the same.
Since this error has been localized to certain android devices, our current assumption is that it's something unique about those android builds. It will be really helpful if you can reproduce this issue on emulator and can share the raw http response from salesforce.
This happens when I try to refresh my tabs-list (by pulling down and releasing). Update to latest SF1 version (7.3.1 Build 56) did not help.
This is still happening using Salesforce SDK 3.3.1 (the current latest). On Android 4.2.2 (Same as above)
Cheers