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

插件详情v0.0.3

okta_oidc

一个用于 Okta OIDC 身份验证的 Flutter 插件,可使用 Okta 服务通过 OpenID Connect 实现安全的用户登录、令牌管理和身份集成。

AndroidiOS
近 30 天下载
3220
喜欢数
7
Pub 分数
140

安装插件

flutter pub add okta_oidc

插件介绍

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

okta_oidc 包是一个 Flutter 插件,可使用 Okta 服务通过 OpenID Connect 实现安全的身份验证。它可在 Android 和 iOS 平台上实现无缝用户登录、令牌管理和身份集成。专为希望将 Okta 身份解决方案集成到 Flutter 应用的开发者设计,该插件安全地处理 OAuth 2.0 流程、令牌存储和会话管理。该插件简化了现代身份验证工作流的实现,确保符合行业标准。在需要强大身份验证和访问控制的企业应用中尤其有用。

适合场景

  • 企业应用身份验证
  • 单点登录(SSO)集成
  • 使用 Okta 实现安全的用户登录
  • 基于令牌的授权
  • 移动应用身份管理

主要特点

  • OpenID Connect 支持
  • 安全的令牌处理
  • 跨平台(Android 和 iOS)
  • Okta 服务集成
  • 会话管理

适合对象

  • 企业移动应用
  • 需要 SSO 的应用
  • 使用 Okta 身份服务的开发人员
  • 认证密集型应用
  • Flutter 应用需要安全登录

使用建议

  • 需要设置 Okta 帐户
  • 需要正确配置重定向 URI
  • 依赖于平台特定的 OAuth 处理
  • 仅限 Okta OIDC 提供商
  • 可能需要额外的后端验证

原始 README

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

okta_oidc

okta_oidc provide simple authentication integration in mobile apps.

Sample

Check out sample app Okta oidc

Installation

To add okta_oidc to your flutter application install instructions. Below are some Android and iOS specifics that are required for the okta_oidc to work correctly.

Android
  1. Make sure you set the minSdkVersion 21 or above in your "android/app/build.gradle"
android {
  minSdkVersion 21

  ...
}
  1. Similar to the sample app, you must add a redirect scheme to receive sign in results from the web browser. To do this, you must define a gradle manifest placeholder in your app's build.gradle:
manifestPlaceholders = [
    appAuthRedirectScheme: 'Add redirect schema here...'
  ]
iOS
  1. Make sure the minimum deployment target in Podfile set to 13 or above
platform :ios, '13.0'

Add `assets/okta_config.json` file in root of your project with below data.
{
  "client_id": "",
  "redirect_uri": "",
  "end_session_redirect_uri": "",
  "scopes": [],
  "discovery_uri": ""
}

Example

Available Methods
initOkta

This method will initialize okta with config file or map data.

code
OktaOidc oktaOidc = OktaOidc();

...
...

 Future<void> initOkta() async {
    final String response =
        await rootBundle.loadString('assets/okta_config.json');
    Map<String, dynamic>? oktaConfig = jsonDecode(response);
    oktaOidc.initOkta(oktaConfig);
  }
login

This method will redirect you to okta sign in page and return response or error.

code
 oktaOidc.login().then((value) {
                }).catchError((onError) {
                });
socialLogin

This method can be used for social login like linked in, google and apple sign in. Need to provide idp and idp-scope for social sign in.

code
  oktaOidc.socialLogin({
      "idp": "Add idp here...",
      "idp-scope": "Add scope here..."
    }).then((value) {
    });
getAccessToken

This method will return access token if logged in if token is expired it will refresh the token.

code
  oktaOidc.getAccessToken();
getUserProfile

This method returns user profile data.

code
  oktaOidc.getUserProfile();
logout

This method clears the user session.

code
  oktaOidc.logout();

所属分类

依赖

依赖清单 1 项

  • plugin_platform_interface^2.0.2

源码仓库

使用此插件的项目

暂无相关数据。