FIDO Only
This article assumes you have already completed the HYPR SDK Quick Start before continuing.
FIDO Only SDK is designed for customers who want to use the HYPR SDK to authenticate into their own application without using the HYPR out-of-band mechanism. It establishes direct communication with a HYPR RP Server / HYPR FIDO Server.
The FIDO operations available include registration, authentication, and deregistration.
SDK for Android
SDK Interface
FIDO Only Operations use the HyprApiActionAdapter and HyprDbAdapter SDK interfaces.
The only HYPR code object used in FIDO Only mode is HyprAppProfileData
. It corresponds to a HYPR RP Application Profile.
Most HYPR code objects have a DB ID to uniquely identify them. The SDK interfaces often require a DB ID to indicate which object is being operated on at the time. FIDO Only mode uses the App Profile DB ID.
Basic Architecture
Interface | HyprInit HyprApiActionAdapter HyprDbAdapter |
Related Components | UIAdapter User Agent FIDO Client ASMs Authenticators |
Functionality | FIDO Operations |
Database Setup
During the Quick Start you created a CustomHyprDbAdapter
which extends the HyprDbAdapter
class. FIDO Only (out-of-band Off) mode requires the following modifications to that custom class setup:
-
setting the Application Type,
HyprRpAppType
, toOobOff
-
setting your RP URL,
BaseDomainUrl
-
setting your RP Application ID,
RpAppId
// FIDO Only Additions
appProfile.setHyprRpAppType(context, HyprRpAppType.OobOff);
appProfile.setBaseDomainUrl(context, "https://your-company-hypr-rp-address.com");
appProfile.setRpAppId(context, "your RP Application Id");
The complete class without those additions is shown here:
public class CustomHyprDbAdapter extends HyprDbAdapter {
/**
* Called after a new App Profile is created.
* Put any DB customizations here for the new App Profile.
*
* @param context current context
* @param appProfile appProfile object that was just created
*/
@Override
public void onNewAppProfileCreated(@NonNull final Context context,
@NonNull HyprAppProfileData appProfile) {
// FIDO Only Additions
appProfile.setHyprRpAppType(context, HyprRpAppType.OobOff);
appProfile.setBaseDomainUrl(context, "https://your-company-hypr-rp-address.com");
appProfile.setRpAppId(context, "your RP Application Id");
}
}
FIDO Registration
FIDO Registrations are done on an Application Profile basis. Each Application Profile has a DB ID that typically is used to pass into methods to tell the SDK which Application Profile to use.
HyprApiActionAdapter.registerAuthenticatorsForAppProfile()
is used to launch an activity to initiate FIDO registration via the HyprApiActionAdapter
.
The results are returned in onActivityResults
with the resultCode
of
HYPR_REGISTER_ACT_REQ_CODE
.
-
Using the example below, verify the HYPR Initialization is complete. If you are only using one App Profile, get the current Application Profile and the App Profile DB ID. App Profiles has more details.
-
Pass that App Profile DB ID into the
registerAuthenticatorsForAppProfile
method to start a HYPR SDK activity which will perform the registration. -
The results are returned in the
onActivityResult
method described in the FIDO Operation Activity Results section further below. The result code isHYPR_REGISTER_ACT_REQ_CODE
.void startRegistration(Activity activity) {
if (App.isHyprInitComplete()) {
try {
HyprAppProfileData hyprAppProfileData = App.getHyprDbAdapter().getCurHyprAppProfileData(activity);
HyprApiActionAdapter.registerAuthenticatorsForAppProfile(activity, hyprAppProfileData.getDbId());
} catch (HyprException exception) {
exception.printStackTrace();
}
}
}
FIDO Authentication
FIDO Authentications are done on an Application Profile basis. Each Application Profile has a DB ID that is passed to methods to tell the SDK which Application Profile to use.
HyprApiActionAdapter.authenticateAppProfile()
is used to launch an activity to initiate FIDO registration via the HyprApiActionAdapter
.
The results are returned in onActivityResults
with the resultCode
of:
HYPR_AUTHENTICATE_ACT_REQ_CODE
.
-
Using the example below, verify the HYPR Initialization is complete. If you are only using one App Profile, then get the current Application Profile and the App Profile DB ID. App Profiles has more information on App Profiles.
-
Pass that App Profile DB ID into the
authenticateAppProfile
method to start a HYPR SDK activity which will perform the authentication. -
The results are returned in the
onActivityResult
method described in the FIDO Operation Activity Results section further below. The result code isHYPR_AUTHENTICATE_ACT_REQ_CODE
.
void startAuthentication(Activity activity) {
if (App.isHyprInitComplete()) {
try {
HyprAppProfileData hyprAppProfileData = App.getHyprDbAdapter().getCurHyprAppProfileData(activity);
HyprApiActionAdapter.authenticateAppProfile(activity, hyprAppProfileData.getDbId());
} catch (HyprException exception) {
exception.printStackTrace();
}
}
}