https://github.com/dotkernel/dot-controller-plugin-authentication
DotKernel authentication controller plugin component
https://github.com/dotkernel/dot-controller-plugin-authentication
Last synced: 7 months ago
JSON representation
DotKernel authentication controller plugin component
- Host: GitHub
- URL: https://github.com/dotkernel/dot-controller-plugin-authentication
- Owner: dotkernel
- License: mit
- Created: 2016-10-07T16:01:56.000Z (about 9 years ago)
- Default Branch: 2.9-PHP-8.1
- Last Pushed: 2024-03-22T15:17:41.000Z (over 1 year ago)
- Last Synced: 2025-04-21T08:20:26.878Z (8 months ago)
- Language: PHP
- Homepage:
- Size: 22.5 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# dot-controller-plugin-authentication
Authentication controller plugin.
> [!CAUTION]
> ## Security-Only Maintenance Mode
>
> This package is considered feature-complete, and is now in **security-only** maintenance mode.
>

[](https://github.com/dotkernel/dot-controller-plugin-authentication/blob/2.0.3/LICENSE.md)

## Installation
Run the following command
```bash
$ composer require dotkernel/dot-controller-plugin-authentication
```
This will also install package `dotkernel/dot-controller` and `dotkernel/dot-authentication` as dependencies
Enable the module by merging the `ConfiProvider` output to your application's configuration, to register the services defined by this module.
## Usage
In any controller, you can access this plugin by calling
```php
$this->authentication()->...
```
This plugin defines 2 methods you can use in your controllers to check for the currently authenticated identity.
```php
$this->authentication()->hasIdentity()
```
Returns a boolean value indicating if there is an authenticated identity or a guest identity
```php
$this->authentication()->getIdentity()
```
Returns the current identity as an hydrated object, as defined in the authentication module