Broarm\EventTickets\App\Controller\Authenticator
TicketValidator.php
- Author: Bram de Leeuw Date: 14/06/2017
Synopsis
class Authenticator
extends Controller
{
- // constants
- const TYPE_ACCOUNT = 'ACCOUNT';
- const VALIDATE_TICKET = 'eventtickets/validate';
- const VALIDATE_TOKEN = 'eventtickets/authenticator/validatetoken';
- // members
- private static string $icon = 'favicon-152.png';
- private static string $validate_path = '';
- private static string $token_header = 'X-Authorization';
- private static string $jwt_alg = 'HS256';
- private static integer $jwt_nbf_offset = 0;
- private static integer $jwt_exp_offset = 9000;
- private static array $allowed_actions = ;
- // methods
- public HTTPResponse index()
- public static bool|SS_HTTPResponse authenticate()
- public bool|HTTPRequest validateToken()
- private static mixed jwtSecretKey()
Hierarchy
Extends
- SilverStripe\Control\Controller
Tasks
Line | Task |
---|---|
162+ | refresh token when valid |
Constants
Name | Value |
---|---|
TYPE_ACCOUNT | 'ACCOUNT' |
VALIDATE_TICKET | 'eventtickets/validate' |
VALIDATE_TOKEN | 'eventtickets/authenticator/validatetoken' |
Members
private
- $allowed_actions
- $icon
- $jwt_alg
- $jwt_exp_offset
- $jwt_nbf_offset
- $token_header
- $validate_path
Methods
private
- jwtSecretKey() — Get the token or return an error response
public
- authenticate() — Authenticate by given JWT
- index() — Handle the request
- validateToken()