Initialize the BlackBerry AppSecure SDK in your Android app
BlackBerry AppSecure SDK
in your Android app- Import theBlackBerry AppSecure SDKinto an activity.import com.blackberry.security.core.SecurityControl;
- CallenableSecurity.private SecurityControl mSecurity; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Initialize BlackBerry Security Library mSecurity = new SecurityControl(this.getApplicationContext()); mSecurity.enableSecurity();
- Retrieve the identity token of your authenticated user from your IDP.The ID token is a JSON Web Token (JWT), which is a cryptographically-signed, Base64-encoded JSON object. To retrieve the ID token from your IDP, you must have already authenticated the user.If you are usingFirebase, the ID token can be retrieved by following the Firebase instructions to retrieve ID tokens on clients. Other IDPs that are compliant withOpenID Connecttypically provide an endpoint and client library which returns the ID token.
- Provide the identity token to theBlackBerry AppSecure SDKruntime.mSecurity.provideToken(idtoken)
- Confirm that theInitializationStateof the runtime is 'active'.
Using the BlackBerry AppSecure SDK API reference, configure your application to be notified when a threat is detected.