SamlRepository.php 857 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php


namespace Source\Gateways\Saml;


use Source\Entities\SamlUser;

interface SamlRepository {
    /**
     * This function returns the url to redirect to to log a user in.
     *
     * @param array $options
     * @return string
     */
    public function login(array $options = []): string;

    /**
     * Processes a user after a login and returns the logged in user.
     * If null is returned, the user was not able to be created, or
     * they could not be logged in.
     *
     * @return SamlUser|null
     */
    public function handleLogin(): ?SamlUser;

    /**
     * This returns the logout url to redirect to.
     *
     * @return string
     */
    public function logout(): string;

    /**
     * Checks if the current user is authenticated or not
     *
     * @return bool
     */
    public function isAuthenticated(): bool;
}