Francessco121/msal-js-dart
A Dart wrapper for the "Microsoft Authentication Library for JavaScript (MSAL.js)".
go to github downloadMSAL.js for Dart
A Dart wrapper for the Microsoft Authentication Library for JavaScript (MSAL.js).
Note: This package wraps the MSAL.js 2.x (
msal-browser
) library. For 1.x (msal-core
) support, please see the latest 1.x release of this package.
Contents
Install MSAL.js
This package is just a Dart wrapper and does not come with a build of MSAL.js. Please refer to the MSAL.js documentation for installation. Please note that you will need a CDN build of MSAL.js and not an NPM build.
Version Compatibility
This package will match the version of MSAL.js which it supports up to the minor revision. For example, version 2.14.0
of this package supports MSAL.js 2.14.x
. If MSAL.js increments its minor version without adding or changing its API surface, this package will not have a matching release since there’s nothing to update. Additionally, this package may have patch releases that do not reflect the patch releases from MSAL.js.
Avoid using versions of MSAL.js older than versions of this package. APIs may be available in Dart that do not exist in the JavaScript API and can lead to runtime failures. Newer minor versions of MSAL.js should work fine since both libraries follow semantic versioning.
Usage
Please see the various examples and sample applications for usage information in various scenarios such as:
Additionally, please see the official MSAL.js usage documentation. The examples and samples provided by this package do not cover everything, you will need to read the official MSAL.js documentation to fully understand how to use MSAL.
Class, function, and parameter names are almost all the same between this wrapper and MSAL.js (please see “Differences from MSAL.js” for more information). Following MSAL.js examples with Dart should be straight-forward.
Differences from MSAL.js
This package has a few minor differences from the JavaScript and TypeScript APIs in MSAL.js. These are mainly due to incompatibilities between TypeScript and Dart and quality-of-life differences to provide a more idiomatic Dart API.
- APIs returning JavaScript
Promise
s instead return DartFuture
s. - TypeScript string unions are represented as Dart enums.
- MSAL errors are represented as Dart exceptions and use the suffix
Exception
instead ofError
(e.g.AuthError
in MSAL.js isAuthException
in this wrapper). - Typescript interfaces are represented as a full Dart type. Instead of passing a map which meets the interface requirements, an actual type must be constructed (e.g. instead of
loginPopup({scopes: []})
you would dologinPopup(PopupRequest()..scopes = [])
). PublicClientApplication.handleRedirectPromise
was renamed tohandleRedirectFuture
since it does not return a promise in the Dart API.
Contributing
Contributions to this package are more than welcome! If you have an immediate need for a new MSAL feature to be wrapped or for a bug to be fixed, please consider opening a pull request.
Please see our full contribution guide for more information.
![](/images/banner-woo.jpg)
excellent projects related to Francessco121/msal-js-dart recommend downloading
localsend
33797
An open-source cross-platform alternative to AirDrop
gsy_github_app_flutter
14559
Flutter 超完整的开源项目,功能丰富,适合学习和日常使用。GSYGithubApp系列的优势:我们目前已经拥有Flutter、Weex、ReactNative、kotlin 四个版本。 功能齐全,项目框架内技术涉及面广,完成度高,持续维护,配套文章,适合全面学习,对比参考。跨平台的开源Github客户端App,更好的体验,更丰富的功能,旨在更好的日常管理和维护个人Github,提供更好更方便的驾车体验Σ( ̄。 ̄ノ)ノ。同款Weex版本 : https://github.com/CarGuo/GSYGithubAppWeex 、同款React Native版本 : https://github.com/CarGuo/GSYGithubApp 、原生 kotlin 版本 https://github.com/CarGuo/GSYGithubAppKotlin
dio
12249
A powerful HTTP client for Dart and Flutter, which supports global settings, Interceptors, FormData, aborting and canceling a request, files uploading and downloading, requests timeout, custom adapters, etc.
bloc
11441
A predictable state management library that helps implement the BLoC design pattern
getx
9899
Open screens/snackbars/dialogs/bottomSheets without context, manage states and inject dependencies easily with Get.
flame
8846
A Flutter based game engine.
flutter_deer
7595
🦌 Flutter 练习项目(包括集成测试、可访问性测试)。内含完整UI设计图,更贴近真实项目的练习。Flutter practice project (including integration testing and accessibility testing). Contains complete UI design drawings for a more realistic practice project.
fl_chart
6451
FL Chart is a highly customizable Flutter chart library that supports Line Chart, Bar Chart, Pie Chart, Scatter Chart, and Radar Chart.
riverpod
5828
A reactive caching and data-binding framework. Riverpod makes working with asynchronous code a breeze.
provider
5029
InheritedWidgets, but simple
getwidget
4416
Most popular and easy to use open source UI library with 1000+ Widgets to build flutter app.
fvm
4325
Flutter Version Management: A simple CLI to manage Flutter SDK versions.
pilipala
4003
PiliPala 是使用Flutter开发的BiliBili第三方客户端,感谢使用。
flutter_screenutil
3787
Flutter screen adaptation, font adaptation, get screen information
flutter_rust_bridge
3608
Flutter/Dart <-> Rust binding generator, feature-rich, but seamless and simple.
isar
3366
Extremely fast, easy to use, and fully async NoSQL database for Flutter
bruno
3126
An enterprise-class package of Flutter components for mobile applications. ( Bruno 是基于一整套设计体系的 Flutter 组件库。)
flutter_staggered_grid_view
3043
A Flutter staggered grid view
flutter_hooks
3030
React hooks for Flutter. Hooks are a new kind of object that manages a Widget life-cycles. They are used to increase code sharing between widgets and as a complete replacement for StatefulWidget.
flutter_spinkit
2945
✨ A collection of loading indicators animated with flutter. Heavily Inspired by http://tobiasahlin.com/spinkit.