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
+99-17Lines changed: 99 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,5 @@
1
1
# Univiçosa Laravel OpenId Client
2
2
3
-
|**Laravel**|**laravel-openid-client**|
4
-
|------|------|
5
-
| 5.4 | ^0.7.3 |
6
-
| 5.5 | ^0.7.3 |
7
-
| 5.6 | ^0.7.3 |
8
-
9
3
`univicosa/laravel-openid-client` is a Laravel package which created to integrate the Oauth server to ours Laravel project's that requires authentication.
10
4
11
5
## Install
@@ -16,7 +10,7 @@ Installation using composer:
16
10
composer require univicosa/laravel-openid-client
17
11
```
18
12
19
-
For laravel versions < 5.5 add the service provider in `config/app.php`:
13
+
For Laravel versions < 5.5 add the service provider in `config/app.php`:
Your system need the `oauth public key` to connect and communicate with the Oauth Server.So you need to copy the public key file to `storage` folder of your project.
30
+
31
+
### Redirecting to _Login_
34
32
35
33
In the file `app\Exceptions\Handler.php` find or overwrite the `unauthenticated` method and change the redirect route to:
**PS:** Don't forget change the `SESSION_LIFETIME` in the .env file to the time in minutes you want to keep the logged session.
39
+
### _Session Lifetime_
40
+
41
+
Set a variable called `SESSION_LIFETIME` in the `.env` file and define it to the time in minutes you want to keep the logged session. The max time of the Oauth Server keeps the session is 240 minutes (4 hours).
42
42
43
-
## For change the _Guard_
43
+
###For change the _Guard_
44
44
45
45
change the file `config\auth.php` to:
46
46
@@ -56,17 +56,99 @@ change the file `config\auth.php` to:
56
56
]
57
57
```
58
58
59
-
## Oauth `public key`
59
+
## _Facades_
60
60
61
-
Copy the `oauth public key` to `storage` folder of your project.
61
+
The client methods are available under the facade **\OpenId**.
62
62
63
-
## _Facades_
63
+
The authentication methods like the verifier `\Auth::check()` are available under the Facade **\Illuminate\Support\Facades\Auth**;
64
+
65
+
The facade **\Oauth2** provides all helpers needed to get and post data from the Oauth Server.
64
66
65
-
The client methods are available under the facade OpenId.
67
+
### \Ouath2 methods available
66
68
67
-
The authentication methods like the verifier `\Auth::check()` are available under the Facade `\Illuminate\Support\Facades\Auth`;
69
+
```php
70
+
@method \Oauth2::getSystems(): array
71
+
@api GET '/api/{version}/system'
72
+
73
+
@return array With Systems available in Oauth Server
74
+
```
75
+
76
+
```php
77
+
@method \Oauth2::getSystemRoles(): array
78
+
@api GET '/api/{version}/system/roles'
79
+
80
+
@return array With System givable roles
81
+
```
68
82
69
-
The facade Oauth2 provides all helpers needed to get and post data from the Oauth Server.
83
+
```php
84
+
@method \Oauth2::getUser(): array
85
+
@api GET '/api/{version}/user'
86
+
87
+
@return array With logged user data
88
+
```
89
+
90
+
```php
91
+
@method \Oauth2::getUserByCpf(string $cpf): array
92
+
@api POST '/api/{version}/user/cpf'
93
+
94
+
@return array With the data of user owner of document given
95
+
```
96
+
97
+
```php
98
+
@method \Oauth2::getUserSystems(): array
99
+
@api GET '/api/{version}/user/systems'
100
+
101
+
@return array With the systems that the user is allowed to access
102
+
```
103
+
104
+
```php
105
+
@method \Oauth2::getUserPermissions(): array
106
+
@api GET '/api/{version}/user/permissions'
107
+
108
+
@return array With the roles that the logged user has in the request owner
109
+
```
110
+
111
+
```php
112
+
@method \Oauth2::getGenders(): array
113
+
@api GET '/api/{version}/profile/genders'
114
+
115
+
@return array With th data of all genders available for select on the Oauth Server
0 commit comments