Menu

1 / 2

Entra External ID Login in Ionic: One Capacitor Plugin for iOS, Android and Web

DEV Community: ionic·rout0978·5 days ago
#RZ94Rozv
#devtoionic#devto#dev#msal#android
Reading 0:00
15s threshold

Adding sign-in to a hybrid app gets painful fast when you target Microsoft Entra External ID on iOS, Android and the web at once. The browser needs a redirect flow, iOS needs Keychain set up correctly, and Android wants a signature hash written in two different encodings.

I built @nativelement/capacitor-msal-entra to hide that behind four calls: signIn , acquireTokenSilent , getAccount and signOut . It wraps MSAL Android and MSAL iOS natively and @azure/msal-browser on the web, so you get secure token caching and silent renewal instead of a hand-rolled PKCE flow.

const result = await MsalAuth . signIn ({ scopes : [] }); const { value : account } = await MsalAuth . getAccount (); const token = ( await MsalAuth . acquireTokenSilent ({ scopes : [] })).…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.