You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
Core interfaces for authentication implementations.
4
4
5
-
`dot-authentication` is Dotkernel's authentication base package which define interfaces for authentication services to be used with Dotkernel applications.
5
+
`dot-authentication` is Dotkernel's authentication base package that defines interfaces for authentication services to be used with Dotkernel applications.
6
6
7
7
## Documentation
8
8
@@ -11,7 +11,7 @@ Documentation is available at: https://docs.dotkernel.org/dot-authentication/.
@@ -24,18 +24,18 @@ Documentation is available at: https://docs.dotkernel.org/dot-authentication/.
24
24
25
25
## Installation
26
26
27
-
Run the following command in you project directory
27
+
Run the following command in your project directory
28
28
29
29
```shell
30
30
composer require dotkernel/dot-authentication
31
31
```
32
32
33
-
Please note that usually this package will be installed as a dependency to a concrete implementation, so usually you won't need to add this to you project manually.
33
+
Please note that usually this package will be installed as a dependency to a concrete implementation, so usually you won't need to add this to your project manually.
34
34
35
35
## AuthenticationInterface
36
36
37
-
Defines the interface that should be implemented by any authentication service, in order to work with Dotkernel applications.
38
-
This is a result of the fact that the default packages used by Dotkernel applications, that need access to the authentication service are type-hinted against this interface.
37
+
Defines the interface that should be implemented by any authentication service to work with Dotkernel applications.
38
+
This is a result of the fact that the default packages used by Dotkernel applications that need access to the authentication service are type-hinted against this interface.
39
39
40
40
Also, concrete implementations should be registered in the service manager using this interface's FQN.
41
41
@@ -47,14 +47,14 @@ public function authenticate(ServerRequestInterface $request): AuthenticationRes
47
47
48
48
This method is the implementation of the actual authentication process.
49
49
50
-
It should extract credentials from the `$request` object (Authorization header, custom request attributes etc.).
50
+
It should extract credentials from the `$request` object (Authorization header, custom request attributes, etc.).
51
51
It should return an `AuthenticationResult` object, defined in this package, which carry the authentication status and identity on success.
52
52
53
53
```php
54
54
public function challenge(ServerRequestInterface $request): ResponseInterface;
55
55
```
56
56
57
-
This method should return a valid PSR-7 `ResponseInterface` used to notify the client or browser that it needs to authenticate first(usually using the `WWW-Authenticate` header - useful for HTTP basic and digest authentication).
57
+
This method should return a valid PSR-7 `ResponseInterface` used to notify the client or browser that it needs to authenticate first(usually using the `WWW-Authenticate` header - useful for HTTP basic and digest authentication).
58
58
59
59
```php
60
60
public function hasIdentity(): bool;
@@ -63,12 +63,12 @@ public function setIdentity(IdentityInterface $identity);
63
63
public function clearIdentity();
64
64
```
65
65
66
-
These methods are used to check if authenticated, get the authenticated identity object, force set an identity(maybe useful for auto-login) or clear an identity(logout)
66
+
These methods are used to check if authenticated, get the authenticated identity object, force set an identity(maybe useful for auto-login) or clear an identity(logout).
67
67
68
68
## IdentityInterface
69
69
70
70
You can use any object to represent an authenticated identity(user) as long as it implements this interface.
71
-
It requires 2 methods, `getId()` which should return the unique identifier of the identity, and `getName(): string` which should return a string representation of the identity(for display purposes, usually the email or username).
71
+
It requires two methods, `getId()` which should return the unique identifier of the identity, and `getName(): string` which should return a string representation of the identity(for display purposes, usually the email or username).
72
72
73
73
## AuthenticationResult
74
74
@@ -77,7 +77,7 @@ It composes one of the predefined authentication codes, which describes the auth
77
77
78
78
## UnauthorizedException
79
79
80
-
Exception to be thrown when accessing content that need authentication first.
81
-
This can be used within an application to trigger an error and do a custom action(like redirecting to a login page).
82
-
There is not a predefined way to handle this, Dotkernel packages use this exception paired with a custom error handler to handle unauthorized errors.
80
+
Exception to be thrown when accessing content that needs authentication first.
81
+
This can be used within an application to trigger an error and do a custom action(like redirecting to a login page).
82
+
There is not a predefined way to handle this; Dotkernel packages use this exception paired with a custom error handler to handle unauthorized errors.
83
83
When using the frontend or admin applications, this is already setup among the authentication/authorization packages, and throwing an UnauthorizedException from anywhere your application, it will redirect to the login page by default.
Please note that usually this package will be installed as a dependency to a concrete implementation, so usually you won't need to add this to you project manually.
3
+
Please note that usually this package will be installed as a dependency to a concrete implementation, so usually you won't need to add this to your project manually.
Copy file name to clipboardExpand all lines: docs/book/v2/overview.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,12 @@
2
2
3
3
Core interfaces for authentication implementations.
4
4
5
-
`dot-authentication` is Dotkernel's authentication base package which define interfaces for authentication services to be used with Dotkernel applications.
5
+
`dot-authentication` is Dotkernel's authentication base package that defines interfaces for authentication services to be used with Dotkernel applications.
Copy file name to clipboardExpand all lines: docs/book/v2/usage.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,8 @@
2
2
3
3
## AuthenticationInterface
4
4
5
-
Defines the interface that should be implemented by any authentication service, in order to work with Dotkernel applications.
6
-
This is a result of the fact that the default packages used by Dotkernel applications, that need access to the authentication service are type-hinted against this interface.
5
+
Defines the interface that should be implemented by any authentication service to work with Dotkernel applications.
6
+
This is a result of the fact that the default packages used by Dotkernel applications that need access to the authentication service are type-hinted against this interface.
7
7
8
8
Also, concrete implementations should be registered in the service manager using this interface's FQN.
9
9
@@ -15,14 +15,14 @@ public function authenticate(ServerRequestInterface $request): AuthenticationRes
15
15
16
16
This method is the implementation of the actual authentication process.
17
17
18
-
It should extract credentials from the `$request` object (Authorization header, custom request attributes etc.).
18
+
It should extract credentials from the `$request` object (Authorization header, custom request attributes, etc.).
19
19
It should return an `AuthenticationResult` object, defined in this package, which carry the authentication status and identity on success.
20
20
21
21
```php
22
22
public function challenge(ServerRequestInterface $request): ResponseInterface;
23
23
```
24
24
25
-
This method should return a valid PSR-7 `ResponseInterface` used to notify the client or browser that it needs to authenticate first(usually using the `WWW-Authenticate` header - usefull for HTTP basic and digest authentication)
25
+
This method should return a valid PSR-7 `ResponseInterface` used to notify the client or browser that it needs to authenticate first(usually using the `WWW-Authenticate` header - usefully for HTTP basic and digest authentication).
26
26
27
27
```php
28
28
public function hasIdentity(): bool;
@@ -31,12 +31,12 @@ public function setIdentity(IdentityInterface $identity);
31
31
public function clearIdentity();
32
32
```
33
33
34
-
These methods are used to check if authenticated, get the authenticated identity object, force set an identity(maybe useful for auto-login) or clear an identity(logout).
34
+
These methods are used to check if authenticated, get the authenticated identity object, force set an identity(maybe useful for auto-login) or clear an identity(logout).
35
35
36
36
## IdentityInterface
37
37
38
38
You can use any object to represent an authenticated identity(user) as long as it implements this interface.
39
-
It requires 2 methods, `getId()` which should return the unique identifier of the identity, and `getName(): string` which should return a string representation of the identity(for display purposes, usually the email or username)
39
+
It requires two methods, `getId()` which should return the unique identifier of the identity, and `getName(): string` which should return a string representation of the identity(for display purposes, usually the email or username).
40
40
41
41
## AuthenticationResult
42
42
@@ -45,7 +45,7 @@ It composes one of the predefined authentication codes, which describes the auth
45
45
46
46
## UnauthorizedException
47
47
48
-
Exception to be thrown when accessing content that need authentication first.
49
-
This can be used within an application to trigger an error and do a custom action(like redirecting to a login page).
50
-
There is not a predefined way to handle this, Dotkernel packages use this exception paired with a custom error handler to handle unauthorized errors.
48
+
Exception to be thrown when accessing content that needs authentication first.
49
+
This can be used within an application to trigger an error and do a custom action(like redirecting to a login page).
50
+
There is not a predefined way to handle this; Dotkernel packages use this exception paired with a custom error handler to handle unauthorized errors.
51
51
When using the frontend or admin applications, this is already setup among the authentication/authorization packages, and throwing an UnauthorizedException from anywhere your application, it will redirect to the login page by default.
0 commit comments