Trait Handling
Trait for \MvcCore\Ext\Auths\Basic
class. Trait contains:
- Static GetInstance()
method to return singleton instance.
- Constructor to init default config props and to assign pre-route and pre-dispatch application handlers.
- Protected methods to handle: - Pre-route handler - to init sign-in/sign-out form URL addresses and routes if necessary. - Pre-dispatch handler - to assign user instance to prepared controller to dispatch if possible.
Direct Known Users
MvcCore\Ext\Auths\BasicIndirect Known Users
MvcCore\Ext\AuthLocated at ext-auth-basic/src/MvcCore/Ext/Auths/Basic/Handling.php
public static
|
#
GetInstance( array $configuration = [] )
Return singleton instance. If instance exists, return existing instance, if not, create new basic authentication module instance, store it and return it. |
public
|
#
__construct( $config = [] )
Create new Auth service instance. Initialize class definition properties into full class names if their values have no backslash inside. Set up MvcCore application instance reference and set up pre route handler to add authentication routes when necessary and user instance when necessary. |
protected
|
#
preRouteHandler( )
Process necessary operations before request is routed by core router: - Every time try to load user by stored session username from any previous request(s). - If request could target any authentication route or request is post: - Set up sign-in form success url, sign-out form success URL and error URL for both (sign in and sign out) forms, all URLs as current request URL by default. If any URL is configured already, nothing is changed. - Set up sign in or sign out route into router, only route which is currently necessary by authenticated/not authenticated user. |
protected
|
#
preDispatchHandler( )
Try to set up authenticated user into controller instance dispatched by core. |
protected
|
#
preRouteHandlerSetUpUrlAdresses( )
Set up sign in form success url, sign out form success URL and error URL for both sign in/out forms, as current request URL by default. If any URL is configured already, nothing is changed. |
protected
|
#
preRouteHandlerSetUpRouter( )
Set up sign in or sign out route into router, only route which
is currently by authenticated/not authenticated user necessary
to process in |
protected
|
#
getInitializedRoute( string $actionName, string $actionName,… )
Prepare configured route record into route instance if record is string or array. |