\PhpApiToken

This class implements a token resoruce. A file named 'keys.json' should host all token keys that will be accepted by the project.

{ "SystemName": "token_string_123456", "AnotherSystem": "token_string_654321" }

Summary

Methods
Properties
Constants
authenticate()
No public properties found
KEYS_PATH
KEY_INDEX
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

KEYS_PATH

KEYS_PATH

The path to the token keys file (should be at project root)

KEY_INDEX

KEY_INDEX

The header option that contains the API key

Methods

authenticate()

authenticate() : boolean

Checks if the keys.json contains the API key sent at HTTP header.

If keys.json does not exists at project root, then token security will not be used.

Returns

boolean —

Authenticated successfully