TotpMultiFactorGenerator

class TotpMultiFactorGenerator


Helper class used to generate a TotpMultiFactorAssertion.

Summary

Constants

const String!
FACTOR_ID = "totp"

Public functions

java-static Task<TotpSecret!>

Creates a TOTP secret as part of enrolling a TOTP (time-based one-time password) second factor.

java-static TotpMultiFactorAssertion

Creates an assertion for completing the enrollment flow.

java-static TotpMultiFactorAssertion
getAssertionForSignIn(enrollmentId: String, otp: String)

Creates an assertion for the sign-in flow.

Constants

FACTOR_ID

const val FACTOR_ID = "totp": String!

Public functions

generateSecret

java-static fun generateSecret(session: MultiFactorSession): Task<TotpSecret!>

Creates a TOTP secret as part of enrolling a TOTP (time-based one-time password) second factor. This method uses the auth instance corresponding to the user in the MultiFactorSession.

Parameters
session: MultiFactorSession

MultiFactorSession.

getAssertionForEnrollment

java-static fun getAssertionForEnrollment(secret: TotpSecret, otp: String): TotpMultiFactorAssertion

Creates an assertion for completing the enrollment flow.

Parameters
secret: TotpSecret

obtained from the generateSecret step.

otp: String

one-time password obtained from the TOTP App.

getAssertionForSignIn

java-static fun getAssertionForSignIn(enrollmentId: String, otp: String): TotpMultiFactorAssertion

Creates an assertion for the sign-in flow.

Parameters
enrollmentId: String

identifies the TOTP second factor being used.

otp: String

one-time password obtained from the TOTP App.