搜尋套件、儲存庫與 APP 分類

GitHub 儲存庫nirmalvora/okta_oidc

okta_oidc

nirmalvora/okta_oidc open-source repository details.

okta_oidc 專案封面
星標
3
分支
2
最近推送(UTC)
2025年6月4日
專案狀態
未封存

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

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();
Nirmal Vora GitHub avatar
GitHub 作者

Nirmal Vora ↗

語言DartSwiftKotlinRubyObjective-C

此儲存庫發佈的套件

使用的依賴

依賴清單 4 項

  • flutter{"sdk":"flutter"}
  • plugin_platform_interface^2.0.2
  • flutter_test開發依賴{"sdk":"flutter"}
  • flutter_lints開發依賴^2.0.0

如何選擇適合專案的儲存庫?

先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。

  1. 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
  2. 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
  3. 使用前在 GitHub 確認 README、授權條款與 Issues。

來源與維護

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

GitHub Docs — About repositories ↗