Authenticator
last analyzed

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 29

3 Methods

Rating   Name   Duplication   Size   Complexity  
authenticate() 0 1 ?
setServer() 0 1 ?
getServer() 0 1 ?
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Conrad
5
 * Date: 17/11/2017
6
 * Time: 11:23 AM
7
 */
8
9
namespace AdvancedLearning\Oauth2Server\Services;
10
11
12
use AdvancedLearning\Oauth2Server\Exceptions\AuthenticationException;
13
use League\OAuth2\Server\ResourceServer;
14
use SilverStripe\Control\HTTPRequest;
15
16
interface Authenticator
17
{
18
    /**
19
     * Authenticate the request. Returns modified request (probably not as SS doesn't support
20
     * request attributes).
21
     *
22
     * @param HTTPRequest $request The SilverStripe request object to be authenticated.
23
     *
24
     * @return HTTPRequest
25
     * @throws AuthenticationException
26
     */
27
    public function authenticate(HTTPRequest $request): HTTPRequest;
28
29
    /**
30
     * Override the default ResourceServer.
31
     *
32
     * @param ResourceServer $v The new ResourceServer to use.
33
     *
34
     * @return $this
35
     */
36
    public function setServer(ResourceServer $v): Authenticator;
37
38
    /**
39
     * Get the ResourceServer.
40
     *
41
     * @return ResourceServer
42
     */
43
    public function getServer(): ResourceServer;
44
}