Flutter
Getting started
in pubspec.yaml add this:
dependencies:
onegini: 1.0.0
flutter clean
flutter pub get
The first time running you have to fetch flutter packages. Onegini class - main class for comunication between flutter and Native platforms.
SDK Configuration
- Get access to https://repo.onegini.com/artifactory/onegini-sdk
- Use https://github.com/Onegini/onegini-sdk-configurator on your application (instructions can be found there)
Onegini Documentation
- Android https://docs.onegini.com/msp/stable/android-sdk/.com/msp/stable/ios-sdk/
- iOS https://docs.onegini.com/msp/stable/ios-sdk/
App Configuration
Android:
-
Modify
android/app/build.gradle:1.1. Add to
androidsection:lintOptions { abortOnError false }
1.2 Add to
android->defaultConfigsection:minSdkVersion 21 multiDexEnabled true
-
Add to
android/app/proguard-rules.pro:-keep class com.onegini.mobile.SecurityController { *; }
-
Add to
android/build.gradleallprojects.repositories:dependencies { classpath 'com.android.tools.build:gradle:4.0.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" }
mavenCentral() maven { /* Before the release please change the url below to: https://repo.onegini.com/artifactory/onegini-sdk Please change it back to https://repo.onegini.com/artifactory/public after the release */ url "https://repo.onegini.com/artifactory/onegini-sdk" credentials { username "YOUR_USERNAME" password "YOUR_PASSWORD" } }
-
Modify
android/app/src/main/AndroidManifest.xml. Add<intent-filter>to your .MainActivity for listening browser redirects. !!! scheme="oneginiexample" should be changed to your(will be provided by onegini-sdk-configurator) schema:
iOS (>= 12.0):
-
The Onegini SDK is uploaded to the Onegini Artifactory repository. In order to let CocoaPods use an Artifactory repository you need to install a specific plugin.
gem install cocoapods-art -
The Onegini SDK repository is not a public repository. You must provide credentials in order to access the repo. Create a file named .netrc in your Home folder (~/) and add the following contents to it:
machine repo.onegini.com login <username> password <password>Replace the
-
The Onegini CocoaPods repository must be added to your local machine using the following command:
pod repo-art add onegini https://repo.onegini.com/artifactory/api/pods/cocoapods-public -
In order to update the Repository you must manually perform an update:
pod repo-art add onegini https://repo.onegini.com/artifactory/api/pods/cocoapods-public -
In the
podfile has to be added at the beginning this partios/Podfile:source 'https://github.com/artsy/Specs.git' source 'https://github.com/CocoaPods/Specs.git' platform :ios, '12.0' plugin 'cocoapods-art', :sources => [ 'onegini' ]post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) target.build_configurations.each do |config| config.build_settings['ENABLE_BITCODE'] = 'NO' config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0' end end end -
Run
pod install -
Add
SecurityController.handSecurityController.mas described HERE to native's part of code.
Libraries
- callbacks/onegini_custom_two_step_registration_callback
- callbacks/onegini_fingerprint_callback
- callbacks/onegini_otp_accept_deny_callback
- callbacks/onegini_pin_authentication_callback
- callbacks/onegini_pin_registration_callback
- callbacks/onegini_registration_callback
- constants/constants
- model/authentication_attempt
- model/onegini_error
- model/onegini_event
- model/onegini_list_response
- model/onegini_removed_user_profile
- model/oneginiAppToWebSingleSignOn
- model/registration_response
- onegini
- onegini_event_listener
- resources_methods
- user_client