I have an Ionic app that needs to authenticate in Azure and i follow this stackoverflow: Ionic and MSAL Authentication
All did go fine except for iOS where im getting
AADSTS9002326: Cross-origin token redemption is permitted only for the 'Single-Page Application' client-type. Request origin: 'capacitor://localhost'
I did try register this url on mobile and computer urls as SPA needs to have http or https so this is not valid...
Anyone knows how to fix this issue?
Thank you
The error "Cross-origin token redemption is permitted only for the 'Single-Page Application' client-type" usually occurs if the Microsoft Entra ID application is not configured as SPA and you are making use of SPA authentication.
In your case, as your redirecting URL is
capacitor://localhost, you cannot configure it as SPA as SPA supports only http or https. Refer this MsDoc.Hence to resolve the error, either you have to configure the application as Mobile and desktop application and use your custom
capacitor://localhostredirect URL:For sample:
Otherwise, if you want to make use of SPA authentication, then you need to make use of some other redirect URL https or http and configure the application as Single-page application:
Reference:
Use redirect URIs with MSAL (iOS/macOS) - Microsoft identity platform | Microsoft