aad_b2c_webview 0.0.42 copy "aad_b2c_webview: ^0.0.42" to clipboard
aad_b2c_webview: ^0.0.42 copied to clipboard

A simple Flutter package which embeds weview for accessing Azure AD B2C user flow endpoint.

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 #

Embedded web view for Azure AD B2C for providing in-app experience Redirects to the route specified in redirectRoute after successful sign in Successfully secures the id token or access token in the app using flutter secure storage Navigates to screen in app after successful sign in

Getting started #

To use the package in your Flutter app, add the following code to your main.dart file:

dependencies:
  aad_b2c_webview: ^0.0.1

Usage #

Example added in aad-b2c-webview/aad_b2c folder

@override
Widget build(BuildContext context) {
  return MaterialApp(
    title: 'Flutter Demo',
    theme: ThemeData(
      primaryColor: const Color(0xFF2F56D2),
      textTheme: const TextTheme(
        headlineLarge: TextStyle(
          color: Colors.black,
          fontSize: 32,
          fontWeight: FontWeight.w700,
          fontFamily: 'UberMove',
        ),
        bodyText1: TextStyle(
          color: Color(0xFF8A8A8A),
          fontSize: 17,
          fontWeight: FontWeight.w400,
          fontFamily: 'UberMoveText',
        ),
        headline2: TextStyle(
          fontSize: 18,
          color: Colors.black,
          fontWeight: FontWeight.w700,
          fontFamily: 'UberMove',
        ),
      ),
    ),
    debugShowCheckedModeBanner: false,
    initialRoute: '/',
    routes: {
      // When navigating to the "/" route, build the Create Account widget.

      '/': (context) => const ADB2CEmbedWebView(
        url: '<user_flow_endpoint>',
        redirectUrl: '<redirect_uri_of_user_flow>',
        redirectRoute: '<route_to_redirect_to_after_sign_in>',
        onRedirect: onRedirect,
      ),
    },
  );
}
18
likes
0
pub points
79%
popularity

Publisher

verified publishermicrosoft.com

A simple Flutter package which embeds weview for accessing Azure AD B2C user flow endpoint.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

dio, flutter, flutter_secure_storage, jwt_decoder, logger, mockito, pkce, webview_flutter

More

Packages that depend on aad_b2c_webview