<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: rout0978</title>
    <description>The latest articles on DEV Community by rout0978 (@rout0978_c34bb14d2e1d3548).</description>
    <link>https://dev.to/rout0978_c34bb14d2e1d3548</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2222638%2F1e7009c5-85c2-4f4a-8dda-ed76d0af71a8.png</url>
      <title>DEV Community: rout0978</title>
      <link>https://dev.to/rout0978_c34bb14d2e1d3548</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rout0978_c34bb14d2e1d3548"/>
    <language>en</language>
    <item>
      <title>Entra External ID Login in Ionic: One Capacitor Plugin for iOS, Android and Web</title>
      <dc:creator>rout0978</dc:creator>
      <pubDate>Sat, 10 Oct 2026 23:32:59 +0000</pubDate>
      <link>https://dev.to/rout0978_c34bb14d2e1d3548/entra-external-id-login-in-ionic-one-capacitor-plugin-for-ios-android-and-web-4p1p</link>
      <guid>https://dev.to/rout0978_c34bb14d2e1d3548/entra-external-id-login-in-ionic-one-capacitor-plugin-for-ios-android-and-web-4p1p</guid>
      <description>&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;I built &lt;a href="https://www.npmjs.com/package/@nativelement/capacitor-msal-entra" rel="noopener noreferrer"&gt;&lt;code&gt;@nativelement/capacitor-msal-entra&lt;/code&gt;&lt;/a&gt; to hide that behind four calls: &lt;code&gt;signIn&lt;/code&gt;, &lt;code&gt;acquireTokenSilent&lt;/code&gt;, &lt;code&gt;getAccount&lt;/code&gt; and &lt;code&gt;signOut&lt;/code&gt;. It wraps MSAL Android and MSAL iOS natively and &lt;code&gt;@azure/msal-browser&lt;/code&gt; on the web, so you get secure token caching and silent renewal instead of a hand-rolled PKCE flow.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;MsalAuth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;signIn&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;scopes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;account&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;MsalAuth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getAccount&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;MsalAuth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;acquireTokenSilent&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;scopes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="p"&gt;})).&lt;/span&gt;&lt;span class="nx"&gt;accessToken&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few things the full tutorial covers that the docs don't put in one place:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why the Android signature hash is URL-encoded in &lt;code&gt;msal_config.json&lt;/code&gt; but raw in the manifest&lt;/li&gt;
&lt;li&gt;The missing Keychain entitlement that makes &lt;code&gt;getAccount()&lt;/code&gt; fail with &lt;code&gt;OSStatus -34018&lt;/code&gt; even though sign-in "worked"&lt;/li&gt;
&lt;li&gt;Why &lt;code&gt;signIn()&lt;/code&gt; never resolves on web, and how to restore the session on startup instead&lt;/li&gt;
&lt;li&gt;The case-sensitive &lt;code&gt;domainHint: 'Google'&lt;/code&gt; for skipping the provider picker&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The tutorial also has a table of 11 real failure symptoms with causes and fixes, an Angular auth service, guard and HTTP interceptor, and backend token validation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read the full tutorial:&lt;/strong&gt; &lt;a href="https://habitualcs.io/post/entra-external-id-login-in-ionic-a-capacitor-msal-plugin-tutorial" rel="noopener noreferrer"&gt;Entra External ID Login in Ionic: A Capacitor MSAL Plugin Tutorial&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Code: &lt;a href="https://github.com/NativElement/capacitor-msal-entra" rel="noopener noreferrer"&gt;plugin&lt;/a&gt; · &lt;a href="https://github.com/deepakrout/msal-entra-ionic-demo" rel="noopener noreferrer"&gt;demo Ionic app&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ionic</category>
      <category>capacitor</category>
      <category>azure</category>
      <category>authentication</category>
    </item>
  </channel>
</rss>
