Overview

Authentication adapter for TypeKey.

Requires that PHP have been compiled using "--enable-bcmath" or '--with-gmp'.

Based largely on PEAR Auth_Typekey proposal by Daiji Hirata, in particular the DSA signature verification methods. See the original code at » http://www.uva.ne.jp/Auth_TypeKey/Auth_TypeKey.phps.

Developed for, and then donated by, Mashery.com » http://mashery.com.

For more info on TypeKey, see ...

Package

This class is part of the Solar_Auth package.

Inheritance:

Configuration Keys

  • expire: Authentication lifetime in seconds; zero is forever. Default is 14400 (4 hours). If this value is greater than the non-zero PHP ini setting for session.cookie_lifetime, it will throw an exception.

  • idle: Maximum allowed idle time in seconds; zero is forever. Default is 1440 (24 minutes). If this value is greater than the the PHP ini setting for session.gc_maxlifetime, it will throw an exception.

  • allow: Whether or not to allow automatic login/logout at start() time. Default true.

  • cache: A Solar_Cache dependency for storing the TypeKey public key data.

  • source: The source for auth credentials, 'get' (via the for GET request vars) or 'post' (via the POST request vars). Default is 'post'.

  • source_handle: Username key in the credential array source, default 'handle'.

  • source_passwd: Password key in the credential array source, default 'passwd'.

  • source_redirect: Element key in the credential array source to indicate where to redirect on successful login or logout, default 'redirect'.

  • source_process: Element key in the credential array source to indicate how to process the request, default 'process'.

  • process_login: The source_process element value indicating a login request; default is the 'PROCESS_LOGIN' locale key value.

  • process_logout: The source_process element value indicating a logout request; default is the 'PROCESS_LOGOUT' locale key value.

  • login_callback: A callback to execute as part of the login process, whether or not login was successful.

  • logout_callback: A callback to execute as part of the logout process.

  • token: The TypeKey "site token" id against which authentication requests will be made.

  • window: The signature should have been generated within this many seconds of "now". Default is 10 seconds, to allow for long network latency periods.

  • cache_key: When using a cache, the entry key for the TypeKey public key data. Default 'typekey_pubkey'.

Constants

None.

Public Properties

These are all the public properties in the Solar_Auth_Adapter_Typekey class.

You can also view the list of all public, protected, and private properties.

$allow

Whether or not to allow automatic login/logout at start() time.

Public Methods

These are all the public methods in the Solar_Auth_Adapter_Typekey class.

You can also view the list of all public, protected, and private methods.

__construct()

Constructor.

__destruct()

Default destructor; does nothing other than provide a safe fallback for calls to parent::__destruct().

__get()

Magic get for pseudo-public properties as defined by Solar_Auth_Adapter::$_magic.

__set()

Magic set for pseudo-public properties as defined by Solar_Auth_Adapter::$_magic.

dump()

Convenience method for getting a dump the whole object, or one of its properties, or an external variable.

getStatusText()

Retrieve the status text from the cache and then deletes it, making it act like a read-once session flash value.

isAllowed()

Tells whether authentication processing is allowed.

isLoginRequest()

Is the current page-load a login request?

isLogoutRequest()

Tells if the current page load appears to be the result of an attempt to log out.

isValid()

Tells whether the current authentication is valid.

locale()

Looks up class-specific locale strings based on a key.

processLogin()

Processes login attempts and sets user credentials.

processLogout()

Processes logout attempts.

reset()

Resets any authentication data in the cache.

start()

Starts authentication.

updateIdleExpire()

Updates idle and expire times, invalidating authentication if they are exceeded.



Local