ssl – Now that SSLSocketFactory is deprecated on Android, what would be the best way to handle Client Certificate Authentication?-ThrowExceptions

Exception or error: I am working on an Android app that requires Client Certificate Authentication (with PKCS 12 files). Following the deprecation of all that’s apache.http.*, we have started a pretty big work of refactoring on our network layer, and we have decided to go with OkHttp as a replacement, and so far I like …

java – Error "HTTP/1.1 401 Unauthorized" with basic authentication in android – EWS 2010-ThrowExceptions

Exception or error: I refer to this link to request to the server. The problem is sometime (not always, about 20% – 30%, means sometime I can get successful response), I got the 401 error and server response basic authorization challenge expected, but not found. Here is my code: HttpRequestInterceptor preemptiveAuth = new HttpRequestInterceptor() { …

How to resend SMS verification in Firebase Phone Authentication Android?-ThrowExceptions

Exception or error: According to Firebase documentation (https://firebase.google.com/docs/auth/android/phone-auth#send-a-verification-code-to-the-users-phone), there is callback for handling the phone number authentication. mCallbacks = new PhoneAuthProvider.OnVerificationStateChangedCallbacks() { @Override public void onVerificationCompleted(PhoneAuthCredential credential) { Log.d(TAG, “onVerificationCompleted:” + credential); signInWithPhoneAuthCredential(credential); } @Override public void onVerificationFailed(FirebaseException e) { Log.w(TAG, “onVerificationFailed”, e); } @Override public void onCodeSent(String verificationId, PhoneAuthProvider.ForceResendingToken token) { Log.d(TAG, “onCodeSent:” + …

android – How to determine if a Firebase user is signed in using facebook authentication-ThrowExceptions

Exception or error: I am using firebase from google and I have some trouble with user authentication. After logging with facebook I obtain FirebaseUser in AuthStateListener, but how can I detect if this user is logged via facebook or differently? UPDATE As @Frank van Puffelen said FirebaseAuth.getInstance().getCurrentUser().getProviderId() should return “facebook”, but in my case it …

java – HTTP requests with basic authentication-ThrowExceptions

Exception or error: I have to download and parse XML files from http server with HTTP Basic authentication. Now I’m doing it this way: URL url = new URL(“http://SERVER.WITHOUT.AUTHENTICATION/some.xml”); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(new InputSource(url.openStream())); doc.getDocumentElement().normalize(); But in that way I can’t get xml (or I’m just simply …