public class Guardian
extends java.lang.Object
| Constructor and Description |
|---|
Guardian(java.lang.String baseUrl)
Creates an instance for a specific Guardian server URL
|
| Modifier and Type | Method and Description |
|---|---|
void |
confirmEnroll(java.lang.String transactionToken,
java.lang.String otp)
Confirms an enrollment started with
requestEnroll(String, EnrollmentType). |
Enrollment |
confirmEnroll(Transaction transaction,
java.lang.String otp)
Confirms an enrollment started with
requestEnroll(String, EnrollmentType). |
Transaction |
requestEnroll(java.lang.String ticket,
EnrollmentType type)
Request to create an enrollment
|
public Guardian(java.lang.String baseUrl)
baseUrl - the Guardian server URLpublic Transaction requestEnroll(java.lang.String ticket, EnrollmentType type) throws java.io.IOException, GuardianException
ticket - the enrollment tickettype - the enrollment type to requestjava.io.IOException - when there's a connection issueGuardianException - when there's a Guardian specific issuepublic Enrollment confirmEnroll(Transaction transaction, java.lang.String otp) throws java.io.IOException, java.lang.IllegalArgumentException, GuardianException
requestEnroll(String, EnrollmentType).
Use this method to confirm an enrollment transaction once the user scanned the QR code with a TOTP app (for a
transaction initiated with EnrollmentType.TOTP()) or when the user received the OTP code delivered to his
phone number by SMS (for a transaction initiated with EnrollmentType.SMS(String)).
transaction - the enrollment transactionotp - the code obtained from the TOTP app or delivered to the phone number by SMSjava.io.IOException - when there's a connection issuejava.lang.IllegalArgumentException - when the transaction is not validGuardianException - when there's a Guardian specific issue (invalid otp for example)public void confirmEnroll(java.lang.String transactionToken,
java.lang.String otp)
throws java.io.IOException,
java.lang.IllegalArgumentException,
GuardianException
requestEnroll(String, EnrollmentType).
Use this method to confirm an enrollment transaction once the user scanned the QR code with a TOTP app (for a
transaction initiated with EnrollmentType.TOTP()) or when the user received the OTP code delivered to his
phone number by SMS (for a transaction initiated with EnrollmentType.SMS(String)).
This overload is intended for stateless applications where Serializable is not acceptable,
avoiding the necessity of utilising poor practises to preserve Transaction between user actions.
transactionToken - the token associated with the transaction to confirm.otp - the code obtained from the TOTP app or delivered to the phone number by SMSjava.io.IOException - when there's a connection issuejava.lang.IllegalArgumentException - when the transaction is not validGuardianException - when there's a Guardian specific issue (invalid otp for example)