Call Rest API hosted via Application Proxy from React Native Android App

Sohan Dutta 0 Reputation points
2025-01-31T12:00:32.68+00:00

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.

Microsoft Intune Android
Microsoft Intune Android
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Android: An open-source mobile platform based on the Linux kernel, developed by Google, and maintained by the Open Handset Alliance.
328 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
23,066 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.