Call Rest API hosted via Application Proxy from React Native Android App
I have Rest API developed using Django Rest Framework, which is running in an internal corporate server and make public using Microsoft Application Proxy (Pre-Authentication enabled using Microsoft Entra ID).
I have followed the steps mentioned here
https://learn.microsoft.com/en-us/azure/active-directory-b2c/configure-authentication-sample-android-app?tabs=kotlin
https://learn.microsoft.com/en-us/entra/identity/app-proxy/application-proxy-configure-single-sign-on-with-headers
I have enabled Azure OAuth SSO in my React Native App with react-native-app-auth https://commerce.nearform.com/open-source/react-native-app-auth/docs/providers/azure-active-directory
SSO is working fine and I'm able to get the access_token and passing the access_token in Authorization Header as Bearer Token. I was expecting from the docs, this will not throw Entra login screen, but it is and therefore I'm unable to call the API.
But I also added a WebView in the app, from there I'm logging in with Azure AD SSO which is working.
Once I login to the Django App from the WebView, I'm able to call the Rest API.
I'm not sure why I need to login via WebView once to call the API, my though was enabling Header Based SSO and passing the access token should be enough. But it is not working as expected.
Already, spent several weeks on this and help will be appreciated. Thanks.