Use this file to discover all available pages before exploring further.
Guardian for Android SDKは、Guardian機能があるAndroidアプリの作成を支援し、プッシュ通知による多要素認証()へのセキュアなアクセスを提供します。このツールキットによって、組織のルックアンドフィールに合ったGuardianアプリケーションの独自にカスタマイズしたバージョンを構築できます。詳細については、「MFAにプッシュ通知を構成する」を参照してください。Guardian for Android SDKを使用するには、Android APIレベル15以上が必要です。
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");keyPairGenerator.initialize(2048); // you MUST use at least 2048 bit keysKeyPair keyPair = keyPairGenerator.generateKeyPair();
Uri enrollmentUriFromQr = ...; // the URI obtained from a Guardian QR codeCurrentDevice device = new CurrentDevice(context, "fcmToken", "deviceName");Enrollment enrollment = guardian .enroll(enrollmentUriFromQr, device, keyPair) .execute();
また、バックグラウンドスレッドで要求を実行することもできます。
guardian .enroll(enrollmentUriFromQr, device, keyPair) .start(new Callback<Enrollment> { @Override void onSuccess(Enrollment enrollment) { // we have the enrollment data } @Override void onFailure(Throwable exception) { // something failed } });
// at the FCM listener you receive a RemoteMessage@Overridepublic void onMessageReceived(RemoteMessage message) { Notification notification = Guardian.parseNotification(message.getData()); if (notification != null) { // you received a Guardian notification, handle it handleGuardianNotification(notification); return; } /* handle other push notifications you might be using ... */}