contentbox.models.security.twofactor

Interface ITwoFactorProvider

contentbox.models.security.twofactor.ITwoFactorProvider
All Known Implementing Classes:
EmailTwoFactorProvider

ContentBox - A Modular Content Platform Copyright since 2012 by Ortus Solutions, Corp www.ortussolutions.com/products/contentbox --- This is the interface to needed to implement two-factor authentication methods for ContentBox

Class Attributes:
None
Method Summary
boolean allowTrustedDevice()
     If true, then ContentBox will set a tracking cookie for the authentication provider user browser.
any finalize(string code, any author)
     This method is called once a two factor challenge is accepted and valid.
any getAuthorSetupForm(any author)
     Returns html to display to the user for required two-factor fields.
any getAuthorSetupHelp(any author)
     Get the display help for the provider.
any getDisplayName()
     Get the display name for the provider.
any getName()
     Get the internal name of a provider, used for registration, internal naming and more.
any getVerificationHelp()
     Get the verification help for the provider.
struct sendChallenge(any author)
     Send a challenge via the 2 factor auth implementation.
struct verifyChallenge(string code, any author)
     Leverage the default provider to verify a challenge for the specific user.

Method Detail

allowTrustedDevice

public boolean allowTrustedDevice()

If true, then ContentBox will set a tracking cookie for the authentication provider user browser. If the user, logs in and the device is within the trusted timespan, then no two-factor authentication validation will occur.


finalize

public any finalize(string code, any author)

This method is called once a two factor challenge is accepted and valid. Meaning the user has completed the validation and will be logged in to ContentBox now.

Parameters:
code - The verification code
author - The author to verify challenge

getAuthorSetupForm

public any getAuthorSetupForm(any author)

Returns html to display to the user for required two-factor fields

Parameters:
author

getAuthorSetupHelp

public any getAuthorSetupHelp(any author)

Get the display help for the provider. Used in the UI setup screens for the author

Parameters:
author

getDisplayName

public any getDisplayName()

Get the display name for the provider. Used in all UI screens


getName

public any getName()

Get the internal name of a provider, used for registration, internal naming and more.


getVerificationHelp

public any getVerificationHelp()

Get the verification help for the provider. Used in the UI verification screen.


sendChallenge

public struct sendChallenge(any author)

Send a challenge via the 2 factor auth implementation. The return must be a struct with an error boolean bit and a messages string

Parameters:
author - The author to challenge
Returns:
struct:{ error:boolean, messages=string }

verifyChallenge

public struct verifyChallenge(string code, any author)

Leverage the default provider to verify a challenge for the specific user. The return is a structure containing an error flag and a messages string.

Parameters:
code - The verification code
author - The author to verify challenge
Returns:
struct:{ error:boolean, messages:string }