phramework doc
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Namespaces

  • Phramework
    • Authentication
    • Database
      • Operations
    • Exceptions
    • Extensions
    • Models
    • URIStrategy
    • Validate
    • Viewers

Classes

  • Manager

Interfaces

  • IAuthentication

Class Manager

Namespace: Phramework\Authentication
Located at Authentication/Manager.php

Methods summary

public static
# register( string $implementation )

Register an authentication implementation. Implementation must implement \Phramework\Authentication\IAuthentication interface

Register an authentication implementation. Implementation must implement \Phramework\Authentication\IAuthentication interface

Parameters

$implementation
implementation class

Throws

Exception
public static Phramework\Authentication\IAuthentication[]
# getImplementation( )

Returns

Phramework\Authentication\IAuthentication[]
public static array|false
# check( array $params, string $method, array $headers )

Check user's authentication This method iterates through all available authentication implementations tests in priorioty order which of them might be provided and executes

Check user's authentication This method iterates through all available authentication implementations tests in priorioty order which of them might be provided and executes

Parameters

$params
Request parameters
$method
Request method
$headers
Request headers

Returns

array|false
Returns false on error or the user object on success

Throws

Phramework\Exceptions\ServerException
public static
# setUserGetByEmailMethod( callable $callable )

Set the method that accepts email and returns a user object MUST containg a password, id, this method MUST also contain any other attribute specified in JWT::setAttributes method

Set the method that accepts email and returns a user object MUST containg a password, id, this method MUST also contain any other attribute specified in JWT::setAttributes method

Parameters

$callable
public static callable
# getUserGetByEmailMethod( )

Returns

callable
public static
# setAttributes( string[] $attributes )

Set attributes to be copied from user record. Both user_id and id will use the user's id attribute

Set attributes to be copied from user record. Both user_id and id will use the user's id attribute

Parameters

$attributes
public static string[]
# getAttributes( )

Returns

string[]
public static
# setOnAuthenticateCallback( callable $callable )

Set a callback that will be executed after a successful authenticate execution, user object will be provided to the defined callback.

Set a callback that will be executed after a successful authenticate execution, user object will be provided to the defined callback.

Parameters

$callable

Throws

Exception
public static callable
# getOnAuthenticateCallback( )

Returns

callable
public static
# setOnCheckCallback( callable $callable )

Set a callback that will be executed after a successful check execution

Set a callback that will be executed after a successful check execution

Parameters

$callable

Throws

Exception
public static callable
# getOnCheckCallback( )

Returns

callable

Properties summary

protected static array $implementations
# []
protected static callable $userGetByEmailMethod

MUST be set

MUST be set

# null
protected static string[] $attributes
# []
protected static callable|null $onAuthenticateCallback
# null
protected static callable|null $onCheckCallback
# null
phramework doc API documentation generated by ApiGen