Package selection guidance compiled from public package information, community data, and project usage.
A Flutter package that simplifies integration with Azure AD B2C by embedding a web view to access user flow endpoints. It enables seamless authentication flows such as sign-up, sign-in, and password reset directly within the app. Designed for developers using Microsoft's identity platform, it handles the UI rendering of B2C policies through a native web view, reducing the need for custom authentication logic. The package is lightweight and focused on providing a straightforward bridge between Flutter apps and Azure AD B2C services.
Use cases
Integrating Azure AD B2C sign-in flows
Enabling user registration via B2C policies
Supporting password reset workflows
Embedding B2C UI in mobile apps
Handling custom authentication journeys
Key features
Simple web view integration
Direct access to B2C user flows
Minimal setup required
Secure token handling
Built for Microsoft identity ecosystem
Suitable for
Flutter apps using Azure AD B2C
Mobile apps needing secure authentication
Developers familiar with B2C policies
Teams building enterprise-grade apps
Projects requiring minimal custom auth code
Considerations
Requires valid Azure AD B2C configuration
Limited to web view-based flows
No built-in token persistence
Depends on external B2C policy URLs
Not suitable for fully native UI authentication
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
Azure AD B2C Embedded Webview
Azure AD B2C Embedded Webview is a very simple Flutter package that demonstrates how to use the embedded web view to sign in users with Azure AD B2C.
Currently, using Flutter packages - appAuth and flutter_azure_b2c redirects to browser and doesn't provide in-app experience.
This package embeds the web view of the user flow endpoint using flutter_appview and redirects the user as per onRedirect callback method.
📚 Features
Login Button
Webview Interaction
Flutter UI Customization
Dynamic Flutter Layout
Refresh Token
🚀 Getting started
To use the package in your Flutter app, add the following code to your main.dart file:
dependencies:aad_b2c_webview:<latest_version>
🛠️ Usage
Parameters
It is recommended to use env to save the keys securely
You have the flexibility to include optional parameters in order to customize the URL according to your specific requirements. The optionalParameters parameter allows you to pass a list of OptionalParam objects, where each object consists of a key and a value that represent the parameter name and its corresponding value, respectively.
Here's an example of how you can utilize the optionalParameters parameter to add new parameters to the URL:
In the above example, we include two optional parameters: "parameter1" with the value "value1" and "parameter2" with the value "value2". You can include multiple OptionalParam objects within the list to incorporate multiple optional parameters in the URL.
These optional parameters provide you with the ability to customize the behavior of the URL and conveniently transmit additional information as per your needs.
Login Button
To add the easy to use sign in with microsoft button simply use the AADB2CBase.button widget
and a beautiful sign in button appears as shown below.
Configuration
Add the following /android/app/src/main/AndroidManifest.xml inside the tags:
Add it to the redirect URL in the Azure AD B2C project. If you prefer, you can change the redirect URL in our Flutter code to yours (change it in the Azure AD B2C portal too)