https://github.com/flownative/flow-token-auth
Authentication via token string
https://github.com/flownative/flow-token-auth
Last synced: 2 months ago
JSON representation
Authentication via token string
- Host: GitHub
- URL: https://github.com/flownative/flow-token-auth
- Owner: flownative
- License: mit
- Created: 2019-06-25T14:32:23.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2024-10-24T11:23:34.000Z (8 months ago)
- Last Synced: 2024-10-25T06:37:39.334Z (8 months ago)
- Language: PHP
- Size: 35.2 KB
- Stars: 7
- Watchers: 4
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Token based authentication for Neos Flow projects
This package provides token based authentication for Neos Flow projects. It
allows both sessionless and session-based authentication to be used.## Installation
Run:
composer require flownative/token-authentication
## Usage
Run:
./flow hashtoken:createhashtoken --roleNames Neos.Neos:Editor
Provide the token in your requests
- as request argument `_authenticationHashToken=` or
- as `Authorization` header with the value `Bearer `.## Configuration
The configuration is done as usual in the `Configuration/Settings.yaml` file.
```yaml
Neos:
Flow:
security:
authentication:
providers:
'Acme.Com:TokenAuthenticator':
provider: Flownative\TokenAuthentication\Security\HashTokenProvider
requestPatterns:
'Acme.Com:Controllers':
pattern: ControllerObjectName
patternOptions:
controllerObjectNamePattern: 'Acme\Com\Controller\.*'
```By default the package uses a sessionless token. If you want to use a
session-based token, set the `token` option in the provider configuration:```yaml
providers:
'Acme.Com:TokenAuthenticator':
provider: Flownative\TokenAuthentication\Security\HashTokenProvider
token: Flownative\TokenAuthentication\Security\SessionStartingHashToken
```