okta_oidc
一個用於 Okta OIDC 身份驗證的 Flutter 插件,可使用 Okta 服務透過 OpenID Connect 實現安全的使用者登入、權杖管理與身分整合。
nirmalvora/okta_oidc open-source repository details.
{"sdk":"flutter"}^2.0.2{"sdk":"flutter"}^2.0.0以下為英文專案原文快照,最新內容請造訪 GitHub。
okta_oidc provide simple authentication integration in mobile apps.
Check out sample app Okta oidc
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.
minSdkVersion 21 or above in your "android/app/build.gradle"android {
minSdkVersion 21
...
}
manifestPlaceholders = [
appAuthRedirectScheme: 'Add redirect schema here...'
]
platform :ios, '13.0'
{
"client_id": "",
"redirect_uri": "",
"end_session_redirect_uri": "",
"scopes": [],
"discovery_uri": ""
}
initOktaThis method will initialize okta with config file or map data.
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);
}
loginThis method will redirect you to okta sign in page and return response or error.
oktaOidc.login().then((value) {
}).catchError((onError) {
});
socialLoginThis 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.
oktaOidc.socialLogin({
"idp": "Add idp here...",
"idp-scope": "Add scope here..."
}).then((value) {
});
getAccessTokenThis method will return access token if logged in if token is expired it will refresh the token.
oktaOidc.getAccessToken();
getUserProfileThis method returns user profile data.
oktaOidc.getUserProfile();
logoutThis method clears the user session.
oktaOidc.logout();