class GoogleTotpProvider extends Provider with ExecutionContextProvider with api.Logger
Google's TOTP authentication concrete provider implementation.
- Alphabetic
- By Inheritance
- GoogleTotpProvider
- Logger
- ExecutionContextProvider
- Provider
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new GoogleTotpProvider(injectedPasswordHasherRegistry: PasswordHasherRegistry)(implicit executionContext: ExecutionContext)
- injectedPasswordHasherRegistry
used to hash the scratch (or recovery) codes.
- executionContext
the execution context.
- Annotations
- @Inject()
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def authenticate(totpInfo: GoogleTotpInfo, plainScratchCode: String): Future[Option[(PasswordInfo, GoogleTotpInfo)]]
Authenticate the user using a TOTP scratch (or recovery) code.
Authenticate the user using a TOTP scratch (or recovery) code. This method will check each of the previously hashed scratch codes and find the first one that matches the one entered by the user. The one found is removed from
totpInfoand returned for easy client-side bookkeeping.- totpInfo
The original TOTP info containing the hashed scratch codes.
- plainScratchCode
The plain scratch code entered by the user.
- returns
Some tuple consisting of (
PasswordInfo,TotpInfo) if the authentication was successful, None otherwise.
- def authenticate(sharedKey: String, verificationCode: String): Future[Option[LoginInfo]]
Returns some login info when the TOTP authentication with verification code was successful, None otherwise.
Returns some login info when the TOTP authentication with verification code was successful, None otherwise.
- sharedKey
A unique key which identifies a user on this provider (userID, email, ...).
- verificationCode
the verification code generated using TOTP.
- returns
Some login info if the authentication was successful, None otherwise.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- def createCredentials(accountName: String, issuer: Option[String] = None): GoogleTotpCredentials
Returns the generated TOTP credentials including the shared key along with hashed scratch codes for safe storage, plain text scratch codes for first time use and the url to the QR activation code.
Returns the generated TOTP credentials including the shared key along with hashed scratch codes for safe storage, plain text scratch codes for first time use and the url to the QR activation code.
- accountName
A unique key which identifies a user on this provider (userID, email, ...).
- issuer
The issuer name. This parameter cannot contain the colon
- returns
The generated TOTP credentials including the shared key, scratch codes and qr url.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- implicit val executionContext: ExecutionContext
- Definition Classes
- GoogleTotpProvider → ExecutionContextProvider
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def id: String
Returns the provider ID.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isVerificationCodeValid(sharedKey: String, verificationCode: String): Boolean
Returns true when the verification code is valid for the related shared key, false otherwise.
Returns true when the verification code is valid for the related shared key, false otherwise.
- sharedKey
TOTP shared key associated with the user.
- verificationCode
Verification code, presumably valid at this moment.
- returns
true when the verification code is valid for the related shared key, false otherwise.
- Attributes
- protected
- val logger: api.Logger
- Definition Classes
- Logger
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- val passwordHasherRegistry: PasswordHasherRegistry
The Password hasher registry to use
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)