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
# v1.0.0 uses esaml v4.2 which in turn relies on cowboy 2.x
28
+
# If you need to work with cowboy 1.x, you need the following override:
29
+
# {:esaml, "~> 3.7", override: true}
30
+
15
31
defpdeps() do
16
32
[
17
33
# ...
18
-
{:samly, "~> 1.0.0-rc.1"},
19
-
# v1.0.0-rc.1 uses esaml v4.2 which in turn relies on cowboy 2.x
20
-
# If you need to work with cowboy 1.x, you need the following override:
21
-
# {:esaml, "~> 3.7", override: true}
34
+
{:samly, "~> 1.0.0"},
22
35
]
23
36
end
24
37
```
25
-
> Starting v0.10.0, Samly uses Cowboy 2.x. This implies that you need to use `phoenix v1.4` and `plug_cowboy v2.0`. Make sure to update your application's `mix.exs` dependencies to reflect this change. If you do not want to use `phoenix v1.4` and want to use Samly with `phoenix v1.3`, make sure to include `:esaml` v3.7 override in your `mix.exs`.
26
38
27
39
## Supervision Tree
28
40
@@ -33,7 +45,7 @@ Add `Samly.Provider` to your application supervision tree.
33
45
34
46
children = [
35
47
# ...
36
-
worker(Samly.Provider, []),
48
+
{Samly.Provider, []},
37
49
]
38
50
```
39
51
@@ -54,12 +66,15 @@ end
54
66
55
67
## Certificate and Key for Samly
56
68
57
-
`Samly` needs a private key and a corresponding certificate. These are used when
58
-
communicating with the Identity Provider.
69
+
`Samly` needs a private key and a corresponding certificate. These are used to
70
+
sign the SAML requests when communicating with the Identity Provider. This certificate
71
+
should be made available to `Samly` via config settings. It should also be made
72
+
available to the Identity Provider so it can verify the SAML signed requests.
59
73
60
-
A convenient script, `gencert.sh`, is provided in [`samly_howto`](https://github.com/handnot2/samly_howto) to generate the key and certificate.
61
-
Make sure `openssl` is available on your system. The name of the key file and
62
-
certificate file generated should be provided as part of the Samly configuration.
74
+
You can create a self-signed certificate for this purpose. You can use `phx.gen.cert`
75
+
mix task that is available as part of Phoenix 1.4 or use `openssl` directly to generate
76
+
the key and corresponding certificate.
77
+
(Check out [`samly_howto`](https://github.com/handnot2/samly_howto)`README.md` for this.)
63
78
64
79
## Identity Provider Metadata
65
80
@@ -72,14 +87,14 @@ For example, `SimpleSAMLPhp` IdP provides a URL for the metadata. You can fetch
| SAML Assertion Consumer Service |`https://do-good.org/sso/sp/consume/affiliates`|
126
+
| SAML SingleLogout Service |`https://do-good.org/sso/sp/logout/affiliates`|
112
127
113
128
The path segment model is the default one in `Samly`. If there is only one Identity Provider, use this mode.
114
129
@@ -121,22 +136,30 @@ The path segment model is the default one in `Samly`. If there is only one Ident
121
136
122
137
#### Subdomain in Host Name
123
138
124
-
In this model, the subdomain name is used as the idp_id. Here is an example URL: `http://ngo.do-good.org/sso/auth/signin`. Here "ngo" is the idp_id. The URLs supported by `Samly`
139
+
In this model, the subdomain name is used as the idp_id. Here is an example URL: `https://ngo.do-good.org/sso/auth/signin`. Here `ngo` is the idp_id. The URLs supported by `Samly`
125
140
in this model look different.
126
141
127
142
| Description | URL |
128
143
|:----|:----|
129
144
| Sign-in button/link in Web UI |`/sso/auth/signin`|
130
145
| Sign-out button/link in Web UI |`/sso/auth/signout`|
There are two built-in state store options available - one based on ETS and the other on Plug Sessions.
211
232
The ETS store can be setup using the following configuration:
@@ -222,8 +243,10 @@ This state configuration is optional. If omitted, `Samly` uses `Samly.State.ETS`
222
243
|:------------|:-----------|
223
244
|`opts`|_(optional)_ The `:table` option is the ETS table name for storing the assertions. This ETS table is created during the store provider initialization if it is not already present. Default is `samly_assertions_table`. |
224
245
225
-
Use `Samly.State.Session` provider in a clustered deployment. This provider uses the Plug Sessions to keep
226
-
the authenticated SAML assertions. This provider can be enabled using the following:
246
+
> Use `Samly.State.Session` provider in a clustered deployment. This provider uses
247
+
> the Plug Sessions to keep the authenticated SAML assertions.
248
+
249
+
This session based provider can be enabled using the following:
227
250
228
251
```elixir
229
252
config :samly, Samly.State,
@@ -233,12 +256,12 @@ config :samly, Samly.State,
233
256
234
257
| Options | Description |
235
258
|:------------|:-----------|
236
-
|`opts`|_(optional)_ The `:key` is the name of the session key where assertion is stored. Default is `samly_assertion`. |
259
+
|`opts`|_(optional)_ The `:key` is the name of the session key where assertion is stored. Default is `:samly_assertion`. |
237
260
238
261
## SAML Assertion
239
262
240
263
Once authentication is completed successfully, IdP sends a "consume" SAML
241
-
request to `Samly`. `Samly` inturn performs its own checks (including checking
264
+
request to `Samly`. `Samly` in-turn performs its own checks (including checking
242
265
the integrity of the "consume" request). At this point, the SAML assertion
243
266
with the authenticated user subject and attributes is available.
244
267
@@ -344,6 +367,8 @@ in `Samly.Subject.in_response_to` field. It is the responsibility of the consumi
344
367
expects the SAML reqsponses to be signed (both assertion and envelopes). If your IdP is
345
368
not configured to sign, you will have to explicitly turn them off in the configuration.
346
369
It is highly recommended to turn signing on in production deployments.
370
+
+ Encypted Assertions are supported in `Samly`. There are no explicit config settings for this. Decryption happens automatically when encrypted assertions are detected in the SAML response.
0 commit comments