Search code examples
androidreactjsreact-nativeactive-directoryadfs

Token not received after redirecting from login


I am trying to use AD FS as Identity provider with react-native-azure-auth library.

It works fine with iOS, redirects and returns token back from the login screen. However in case of Android, after redirecting from the Login screen it returns error "TypeError: Network request failed]".

I tried to catch exceptions in react-native-azure-auth/src/webauth/index.js in the following code

  const tokenResponse = await client.exchange({
       code,
       scope: scope.toString(),
       code_verifier: verifier
   })

Exception caught "TypeError: Network request failed]"

Just to add more info, I am using a self-signed SSL certificate with my ADFS setup.

Can that be an Issue on Android? as it works perfectly fine with iOS.


Solution

  • Found out the issue was indeed due to use of self-signed certificate, which for some reason was not by-passed on Android. Tried Adding the self-signed certificate on Android device but was of no use.

    Finally added a trusted SSL certificate on the ADFS server and It worked as intended.