Ionic 7 Capacitor: How to set up AzureAD (with Angular MSAL) natively Android

I am currently working on an Android App with Ionic and Angular. For authentication I want to use entra id (former Azure AD). For that I use the Microsoft Authentication Library (MSAL) for Angular. The Web version works just fine, but on mobile device I am not being redirected back to the App. So I thought why not configure a custom uri for that like “myapp://auth” to redirect me to the App. That also works fine but the “#code…” section is not in the Uri so MSAL can not authenticate me in the Frontend (It redirects me to “myapp://auth#code…” but this one redirects me to the login page). Can someone give me a hint / help me. I do not find any documentation or sth. So if you have one, please tell me :slight_smile:

Thank you all!

1 Like

This capacitor plugin solved my problem: GitHub - capacitor-community/generic-oauth2: Generic Capacitor OAuth 2 client plugin. Stop the war in Ukraine!

1 Like