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

插件详情v0.0.9

auth0_web_flutter

一个用于在 Web Flutter 应用中轻松集成 Auth0 的 Flutter 包。

近 30 天下载
256
喜欢数
3
Pub 分数
60

安装插件

flutter pub add auth0_web_flutter

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个专为简化在基于Web的Flutter应用中集成Auth0身份验证而设计的Flutter包。它提供了一个简化的接口,用于处理Web环境中的用户登录、登出和令牌管理。该包利用Auth0强大的身份验证平台,实现安全且可扩展的身份验证,设置简单。它专门针对Web平台优化,确保与浏览器工作流和OAuth2协议兼容。开发者可以使用Auth0的可自定义登录页面和社交提供商支持,快速实现安全的登录流程。

适合场景

  • Web 应用身份验证
  • 用户登录/登出流程
  • 安全的令牌管理
  • 单点登录集成
  • 社交登录实现

主要特点

  • Web 的 Auth0 集成
  • OAuth2 支持
  • 令牌处理
  • 可自定义登录界面
  • Browser-compatible

适合对象

  • Flutter web 开发人员
  • 需要安全认证的应用程序
  • 使用 Auth0 身份平台的项目
  • 带有社交登录的网页应用
  • 优先考虑快速身份验证实施的团队

使用建议

  • 需要 Auth0 账户设置
  • 仅限网页平台
  • 取决于 Auth0 服务的可用性
  • 需要在 Auth0 控制台中进行正确的域名配置
  • 可能需要额外的前端自定义以满足高级用例

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

A Flutter package to easily integrate Auth0 into Web Flutter apps.

Platform Support

Android iOS MacOS Web Linux Windows
x x x ✔️ x x

Auth0FlutterWeb is supported for web only.

Features

Integrate Auth0 authentication across web Flutter apps. Registration and Login users, logout users, and identify currently authenticated users across web.

Usage

To use this plugin, add auth0_flutter2 as a dependency in your pubspec.yaml file.

Web

Add the Auth0 Javascript SPA (Single Page Application) library.

<script src="https://cdn.auth0.com/js/auth0-spa-js/1.13/auth0-spa-js.production.js"></script>

Example

Import the library.

import 'package:auth0_flutter2/auth0_flutter2.dart';

Then initialize the Auth0FlutterWeb class in your main() method.

void main() {
  // add the auth0domain
  Auth0FlutterWeb.auth0Domain = "AUTH0_DOMAIN";
  //add the auth0ClientID
  Auth0FlutterWeb.auth0ClientId = "AUTH0_CLIENT_ID";
// add the redirect uri
  Auth0FlutterWeb.redirectUri = "YOUR_APP_REDIRECT_URI";
  

  // Set the URL strategy for our web app. Removes 
  // trailing hash(#) to ensure login callbacks
  // will be captured and processed correctly.
  Auth0FlutterWeb.setPathUrlStrategy();

  runApp(const MyApp());
}

Then invoke the class methods anywhere in your Dart code.

Auth0FlutterWeb.instance.userAuthentication(screenHint: "signup");
Auth0FlutterWeb.instance.userAuthentication(screenHint: "login");
Auth0FlutterWeb.instance.logoutUser();
Auth0FlutterWeb.instance.getLoggedInUserId();

所属分类

依赖

依赖清单 4 项

源码仓库

使用此插件的项目

暂无相关数据。