contentbox.models.security.twofactor

Class TwoFactorService

lucee.Component
    extended by contentbox.models.security.twofactor.TwoFactorService

ContentBox - A Modular Content Platform Copyright since 2012 by Ortus Solutions, Corp www.ortussolutions.com/products/contentbox --- Manages Two Factor Authenticators

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


    • access = public
    • returntype = any
    • inject = authorService@cb
    true false
    any cookieStorage


    • access = public
    • returntype = any
    • inject = cookieStorage@cbStorages
    true false
    any log


    • access = public
    • returntype = any
    • inject = logbox:logger:{this}
    true false
    struct providers
          Providers registry.

    • access = public
    • returntype = any
    true false
    any securityService


    • access = public
    • returntype = any
    • inject = securityService@cb
    true false
    any settingService


    • access = public
    • returntype = any
    • inject = settingService@cb
    true false
    Constructor Summary
    init(any wirebox)
          Constructor.
    Method Summary
    boolean canChallenge(any author)
         Can we challenge this author for two factor authentication.
    string getAuthorService()
    string getCookieStorage()
    string getDefaultProvider()
         Get the default system provider name.
    ITwoFactorProvider getDefaultProviderObject()
         Get the default system provider object.
    string getLog()
    ITwoFactorProvider getProvider(any name)
         Get a registered provider instance.
    string getProviders()
    array getRegisteredProviders()
         Get an array of registered provider names in alphabetical order.
    array getRegisteredProvidersMap()
         Get an array of registered provider names in alphabetical order with their display names.
    string getSecurityService()
    string getSettingService()
    numeric getTrustedDeviceTimespan()
         Get the default system trusted device timespan.
    boolean hasProvider(any name)
         Check if an provider exists or not.
    boolean isForceTwoFactorAuth()
         Are we forcing global two factor authentication.
    boolean isTrustedDevice(any trustedID)
         Verify if the incoming trusted ID is valid.
    TwoFactorService registerProvider(ITwoFactorProvider provider)
         Register a new two factor authenticator in ContentBox.
    struct sendChallenge(any author)
         Leverage the default provider to send a challenge to the specific user.
    any setAuthorService(any authorService)
    any setCookieStorage(any cookieStorage)
    any setLog(any log)
    any setProviders(struct providers)
    any setSecurityService(any securityService)
    any setSettingService(any settingService)
    TwoFactorService setTrustedDevice(any trustedID)
         Set a trusted device cookie for a user, usually called if the two factor authentication was valid.
    TwoFactorService unRegisterProvider(any name)
         UnRegister a provider in ContentBox.
    struct verifyChallenge(string code, any author)
         Leverage the default provider to verify a challenge for the specific user.
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init(any wirebox)

    Constructor

    Parameters:
    wirebox

    Property Detail

    authorService

    property any authorService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - authorService@cb
    serializable - true

    cookieStorage

    property any cookieStorage

    Attributes:
    access - public
    required - false
    returntype - any
    inject - cookieStorage@cbStorages
    serializable - true

    log

    property any log

    Attributes:
    access - public
    required - false
    returntype - any
    inject - logbox:logger:{this}
    serializable - true

    providers

    property struct providers

    Providers registry

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    securityService

    property any securityService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - securityService@cb
    serializable - true

    settingService

    property any settingService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - settingService@cb
    serializable - true

    Method Detail

    canChallenge

    public boolean canChallenge(any author)

    Can we challenge this author for two factor authentication

    Parameters:
    author - The author to challenge or not

    getAuthorService

    public string getAuthorService()


    getCookieStorage

    public string getCookieStorage()


    getDefaultProvider

    public string getDefaultProvider()

    Get the default system provider name


    getDefaultProviderObject

    public ITwoFactorProvider getDefaultProviderObject()

    Get the default system provider object


    getLog

    public string getLog()


    getProvider

    public ITwoFactorProvider getProvider(any name)

    Get a registered provider instance

    Parameters:
    name - The name of the provider

    getProviders

    public string getProviders()


    getRegisteredProviders

    public array getRegisteredProviders()

    Get an array of registered provider names in alphabetical order


    getRegisteredProvidersMap

    public array getRegisteredProvidersMap()

    Get an array of registered provider names in alphabetical order with their display names


    getSecurityService

    public string getSecurityService()


    getSettingService

    public string getSettingService()


    getTrustedDeviceTimespan

    public numeric getTrustedDeviceTimespan()

    Get the default system trusted device timespan


    hasProvider

    public boolean hasProvider(any name)

    Check if an provider exists or not

    Parameters:
    name - The name of the provider

    isForceTwoFactorAuth

    public boolean isForceTwoFactorAuth()

    Are we forcing global two factor authentication


    isTrustedDevice

    public boolean isTrustedDevice(any trustedID)

    Verify if the incoming trusted ID is valid

    Parameters:
    trustedID - The trusted ID to verify

    registerProvider

    public TwoFactorService registerProvider(ITwoFactorProvider provider)

    Register a new two factor authenticator in ContentBox

    Parameters:
    provider - The provider instance to register

    sendChallenge

    public struct sendChallenge(any author)

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

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

    setAuthorService

    public any setAuthorService(any authorService)

    Parameters:
    authorService

    setCookieStorage

    public any setCookieStorage(any cookieStorage)

    Parameters:
    cookieStorage

    setLog

    public any setLog(any log)

    Parameters:
    log

    setProviders

    public any setProviders(struct providers)

    Parameters:
    providers

    setSecurityService

    public any setSecurityService(any securityService)

    Parameters:
    securityService

    setSettingService

    public any setSettingService(any settingService)

    Parameters:
    settingService

    setTrustedDevice

    public TwoFactorService setTrustedDevice(any trustedID)

    Set a trusted device cookie for a user, usually called if the two factor authentication was valid.

    Parameters:
    trustedID - The trusted ID to track in the tracking cookie

    unRegisterProvider

    public TwoFactorService unRegisterProvider(any name)

    UnRegister a provider in ContentBox

    Parameters:
    name - The name of the provider to unregister

    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 }