Prompt
What should I use for sign in with Microsoft on web and mobile?
Latest observation
Oct 3, 2026
OpenAI APIWeb search: off
For Sign in with Microsoft on web and mobile, the recommended approach is:
Use Microsoft Entra ID with the Microsoft Authentication Library (MSAL)
Why
- Supports both web and mobile
- Uses OAuth 2.0 / OpenID Connect
- Officially supported by Microsoft
- Handles tokens, refresh, SSO, and account management cleanly
What to use by platform
Web
Use:
- MSAL.js (
@azure/msal-browseror@azure/msal-react/@azure/msal-angular)
Best for:
- Single-page apps
- Server-rendered apps with Microsoft sign-in
- Getting ID tokens / access tokens for Microsoft APIs
Mobile
Use:
- MSAL for iOS/Android
- iOS:
MSALvia Swift/Objective-C - Android:
msalfor Android
- iOS:
Or, if you’re using a cross-platform framework:
- React Native: use MSAL-compatible libraries or native wrappers
- Flutter: usually use OAuth/OpenID Connect packages plus system browser-based auth
Important recommendation
For both web and mobile:
- Prefer system browser / system webview-based auth
- Avoid embedding credentials directly in your app
- Use Authorization Code Flow with PKCE
If you mean “Sign in with Microsoft” for consumer accounts
Use Microsoft Entra ID sign-in endpoints that support:
- Work/school accounts
- Microsoft personal accounts if needed
If you only need consumer Microsoft accounts, you may also look at:
- Microsoft identity platform
- App registration configured for:
- single tenant
- multi-tenant
- personal accounts, depending on your audience
Quick choice guide
- Web app → MSAL.js
- Native mobile app → MSAL iOS / Android
- React Native / Flutter → use a library that supports OAuth/OIDC with system browser and integrates with Microsoft identity platform
If you want, I can recommend the exact library and flow based on your stack, like React + React Native, Next.js + iOS, Flutter, etc.