contentbox.modules.contentbox-admin.modules.contentbox-security.modules.contentbox-email-twofactor.models

Class EmailTwoFactorProvider

lucee.Component
    extended by contentbox.models.security.twofactor.BaseTwoFactorProvider
      extended by contentbox.modules.contentbox-admin.modules.contentbox-security.modules.contentbox-email-twofactor.models.EmailTwoFactorProvider
All Implemented Interfaces:
ITwoFactorProvider

ContentBox - A Modular Content Platform Copyright since 2012 by Ortus Solutions, Corp www.ortussolutions.com/products/contentbox --- Provides email two factor authentication. This provider leverages the `template` cache to store unique tokens.

Class Attributes:
  • threadsafe
  •  
  • singleton
  •  
  • synchronized : false
  •  
  • accessors : false
  •  
  • persistent : false
  •  
    Property Summary
    type property default serializable required
    any cache


    • access = public
    • returntype = any
    • inject = cachebox:template
    true false
    any mailService


    • access = public
    • returntype = any
    • inject = mailService@cbmailservices
    true false
    Constructor Summary
    init()
          Constructor.
    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.
    string generateValidationToken(any author)
         This function will store a validation token in hash for the user to validate on.
    any getAuthorOptions()
         Get the author options form.
    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 of the provider.
    any getName()
         Get the internal name of the provider.
    any getVerificationHelp()
         Get the display help for the provider.
    struct sendChallenge(any author)
         Send a challenge via the 2 factor auth implementation.
    struct verifyChallenge(string code, any author)
         Verify the challenge.
     
    Methods inherited from class contentbox.models.security.twofactor.BaseTwoFactorProvider
    discoverSite, getAllSettings, getDefaultSite
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init()

    Constructor


    Property Detail

    cache

    property any cache

    Attributes:
    access - public
    required - false
    returntype - any
    inject - cachebox:template
    serializable - true

    mailService

    property any mailService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - mailService@cbmailservices
    serializable - true

    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.

    Specified by:
    allowTrustedDevice in interface ITwoFactorProvider

    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.

    Specified by:
    finalize in interface ITwoFactorProvider
    Parameters:
    code - The verification code
    author - The author to verify challenge

    generateValidationToken

    public string generateValidationToken(any author)

    This function will store a validation token in hash for the user to validate on

    Parameters:
    author - The author to create the token for.

    getAuthorOptions

    public any getAuthorOptions()

    Get the author options form. This will be sent for saving. You can listen to save operations by listening to the event 'cbadmin_onAuthorTwoFactorSaveOptions'


    getAuthorSetupForm

    public any getAuthorSetupForm(any author)

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

    Specified by:
    getAuthorSetupForm in interface ITwoFactorProvider
    Parameters:
    author

    getAuthorSetupHelp

    public any getAuthorSetupHelp(any author)

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

    Specified by:
    getAuthorSetupHelp in interface ITwoFactorProvider
    Parameters:
    author

    getDisplayName

    public any getDisplayName()

    Get the display name of the provider

    Specified by:
    getDisplayName in interface ITwoFactorProvider

    getName

    public any getName()

    Get the internal name of the provider

    Specified by:
    getName in interface ITwoFactorProvider

    getVerificationHelp

    public any getVerificationHelp()

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

    Specified by:
    getVerificationHelp in interface ITwoFactorProvider

    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

    Specified by:
    sendChallenge in interface ITwoFactorProvider
    Parameters:
    author - The author to challenge
    Returns:
    struct:{ error:boolean, messages=string }

    verifyChallenge

    public struct verifyChallenge(string code, any author)

    Verify the challenge

    Specified by:
    verifyChallenge in interface ITwoFactorProvider
    Parameters:
    code - The verification code
    author - The author to verify challenge
    Returns:
    struct:{ error:boolean, messages:string }