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
{{ message }}
This repository was archived by the owner on Nov 14, 2025. It is now read-only.
Once you publish `saml2.php` to `app/config`, you need to configure your SP. Most of options are inherited from [OneLogin Toolkit](https://github.com/onelogin/php-saml), so you can check documentation there.
60
-
61
-
#### Identity Providers (IdPs)
62
-
63
-
To distinguish between identity providers there is an entity called Tenant that represent each IdP.
54
+
Once you publish `saml2.php` to `app/config`, you need to configure your service provider (SP).
55
+
Most of the options are inherited from [SAML PHP Toolkit], so you can check documentation there.
56
+
This relates to identity providers (IdPs) as well.
64
57
65
-
When request comes to an application, the middleware parses UUID and resolves the Tenant.
66
58
67
-
You can easily manage tenants using the following console commands:
68
59
69
-
-`artisan saml2:create-tenant`
70
-
-`artisan saml2:update-tenant`
71
-
-`artisan saml2:delete-tenant`
72
-
-`artisan saml2:restore-tenant`
73
-
-`artisan saml2:list-tenants`
74
-
-`artisan saml2:tenant-credentials`
60
+
#### Identity Providers
75
61
76
-
> To learn their options, run a command with `-h` parameter.
62
+
Identity providers (IdPs) are configured in the same `saml2.php` configuration file under `idps` key.
63
+
**N.B.** That it is plural (`idp**S**`), unlike in [SAML PHP Toolkit], because we support multiple IdPs.
77
64
78
-
Each Tenant has the following attributes:
79
-
80
-
-**UUID** — a unique identifier that allows to resolve a tenannt and configure SP correspondingly
81
-
-**Key** — a custom key to use for application needs
- By logging out in your app. In this case you SHOULD notify the IdP first so it'll close the global session.
166
-
- By logging out of the global SSO Session. In this case the IdP will notify you on `/saml2/{uuid}/slo` endpoint (already provided).
144
+
- By logging out of the global SSO Session. In this case the IdP will notify you on `/saml2/{key}/sls` endpoint (already provided).
167
145
168
146
For the first case, call `Saml2Auth::logout();` or redirect the user to the route `saml.logout` which does just that.
169
147
Do not close the session immediately as you need to receive a response confirmation from the IdP (redirection).
170
148
That response will be handled by the library at `/saml2/sls` and will fire an event for you to complete the operation.
171
149
172
150
For the second case you will only receive the event. Both cases receive the same event.
173
151
174
-
Note that for the second case, you may have to manually save your session to make the logout stick (as the session is saved by middleware, but the OneLogin library will redirect back to your IdP before that happens):
152
+
Note that for the second case, you may have to manually save your session to make the logout stick (as the session is saved by middleware, but the [SAML PHP Toolkit] library will redirect back to your IdP before that happens):
175
153
176
154
```php
177
155
Event::listen('Slides\Saml2\Events\SignedOut', function (SignedOut $event) {
@@ -184,18 +162,18 @@ Event::listen('Slides\Saml2\Events\SignedOut', function (SignedOut $event) {
184
162
185
163
Sometimes, you need to create links to your application with support of SSO lifecycle. It means you expect a user to be signed in once you click on that link.
186
164
187
-
The most popular example is generating links from emails, where you need to make sure when user goes to your application from email, he will be logged in.
188
-
To solve this issue, you can use helpers that allow you create SSO-friendly routes and URLs — `saml_url()` and `saml_route()`.
189
-
190
-
To generate a link, you need to call one of functions and pass UUID of the tenant as a second parameter, unless your session knows that user was resolved by SSO.
165
+
The most popular example is generating links from emails, where you need to make sure when user goes to your application from email, they will be logged in.
166
+
To solve this issue, you can use helpers that allow you to create SSO-friendly routes and URLs — `saml_url()` and `saml_route()`.
191
167
192
-
> To retrieve UUID based on user, you should implement logic that links your internal user to a tenant.
168
+
To generate a link, you need to call one of functions and pass the IdP key as a second parameter, unless your session knows that user was resolved by SSO.
0 commit comments