搜索插件、代码仓与 APP 分类

GitHub 代码仓Francessco121/msal-js-dart

msal-js-dart

用于“Microsoft 身份验证库 for JavaScript (MSAL.js)”的 Dart 包装器。

msal-js-dart 项目封面
星标
14
复刻
14
最近推送(UTC)
2026年1月20日
项目状态
已归档

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

Pub Version

[!CAUTION] Discontinued: This package is no longer being developed. Please see pub.dev for alternatives or consider creating a fork.

Existing releases will remain available both here on GitHub and on pub.dev.

MSAL.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 Promises instead return Dart Futures.
  • TypeScript string unions are represented as Dart enums.
  • MSAL errors are represented as Dart exceptions and use the suffix Exception instead of Error (e.g. AuthError in MSAL.js is AuthException 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 do loginPopup(PopupRequest()..scopes = [])).
  • PublicClientApplication.handleRedirectPromise was renamed to handleRedirectFuture 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.

Ethan Lafrenais GitHub avatar
GitHub 作者

Ethan Lafrenais ↗

aka Shinx121

Massachusetts, USA官方网站 ↗
语言DartHTML

分类

使用的依赖

依赖清单 3 项

  • js^0.6.3
  • lints开发依赖^1.0.1
  • test开发依赖^1.17.0

如何选择适合项目的代码仓?

先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。

  1. 通过仓库名、作者或描述搜索,再按技术分类缩小范围。
  2. 结合星标、复刻与最近推送比较项目;星标反映社区关注,不代表质量保证。
  3. 使用前在 GitHub 核对 README、许可证与 Issues。

来源与维护

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗