AI-generated Key Takeaways
-
U2fApiClient
is deprecated and developers should use theFido
APIs instead for Security Key operations. -
It served as an entry point for interacting with the U2F (Universal Second Factor) protocol, part of the FIDO standard.
-
It provided methods to initiate U2F registration (
getRegisterIntent
) and signing (getSignIntent
) requests with Security Keys. -
These requests utilized
U2fPendingIntent
to launch the corresponding interactions with the Security Key.
This class is deprecated.
Please use Fido
APIs instead.
The entry point for interacting with the regular app U2F APIs.
U2F (Universal Second Factor) is the name of the Security Key protocol in FIDO (Fast IDentity Online), which is the industry alliance where Security Keys are being standardized.
Public Constructor Summary
U2fApiClient(Activity
activity)
|
|
U2fApiClient(Context
context)
|
Public Method Summary
Task<U2fPendingIntent> | |
Task<U2fPendingIntent> |
Inherited Method Summary
Public Constructors
Public Methods
public Task<U2fPendingIntent> getRegisterIntent (RegisterRequestParams requestParams)
Creates a Task with U2fPendingIntent
.
When this Task object starts, it issues a U2F registration request, which is done once
per U2F device per account for associating the new U2F device with that account. For
example:
Task result = mU2fApiClient.getRegisterIntent(registerRequestParams);
...
result.addOnSuccessListener(
new OnSuccessListener() {
@Override
public void onSuccess(U2fPendingIntent u2fPendingIntent) {
if (u2fPendingIntent.hasPendingIntent()) {
// Start a U2F registration request.
u2fPendingIntent.launchPendingIntent(this, REGISTER_REQUEST_CODE);
}
}
});
result.addOnFailureListener(
new OnFailureListener() {
@Override
public void onFailure(Exception e) {
// Fail
}
}
Parameters
requestParams | for the registration request |
---|
Returns
- Task with PendingIntent to launch U2F registration request
public Task<U2fPendingIntent> getSignIntent (SignRequestParams requestParams)
Creates a Task with U2fPendingIntent
.
When this Task object starts, it issues a U2F signing request for a relying party to
authenticate a user. For example:
Task result = mU2fApiClient.getSignIntent(registerRequestParams);
...
result.addOnSuccessListener(
new OnSuccessListener() {
@Override
public void onSuccess(U2fPendingIntent u2fPendingIntent) {
if (u2fPendingIntent.hasPendingIntent()) {
// Start a U2F sign request.
u2fPendingIntent.launchPendingIntent(this, SIGN_REQUEST_CODE);
}
}
});
result.addOnFailureListener(
new OnFailureListener() {
@Override
public void onFailure(Exception e) {
// Fail
}
}
Parameters
requestParams | for the sign request |
---|
Returns
- Task with PendingIntent to launch U2F signature request