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
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,8 +118,8 @@ SAML requires a x.509 cert to sign and encrypt elements like NameID, Message, As
118
118
119
119
If our environment requires sign or encrypt support, the certs folder may contain the x509 cert and the private key that the SP will use:
120
120
121
-
sp.crt The public cert of the SP
122
-
sp.key The privake key of the SP
121
+
* sp.crt The public cert of the SP
122
+
* sp.key The privake key of the SP
123
123
124
124
Or also we can provide those data in the setting file at the 'x509cert' and the privateKey' json parameters of the 'sp' element.
125
125
@@ -247,6 +247,7 @@ This is the settings.json file:
247
247
248
248
In addition to the required settings data (idp, sp), there is extra information that could be defined at advanced_settings.json
249
249
250
+
```javascript
250
251
{
251
252
// Security settings
252
253
"security": {
@@ -315,6 +316,7 @@ In addition to the required settings data (idp, sp), there is extra information
315
316
}
316
317
}
317
318
}
319
+
```
318
320
319
321
In the security section, you can set the way that the SP will handle the messages and assertions. Contact the admin of the IdP and ask him what the IdP expects, and decide what validations will handle the SP and what requirements the SP will have and communicate them to the IdP's admin too.
320
322
@@ -365,6 +367,7 @@ from onelogin.saml2.utils import OneLogin_Saml2_Utils
365
367
#### The Request ####
366
368
367
369
Building an OneLogin_Saml2_Auth object requires a 'request' parameter.
370
+
368
371
```python
369
372
auth = OneLogin_Saml2_Auth(req)
370
373
```
@@ -379,9 +382,10 @@ req = {
379
382
"get_data":"",
380
383
"post_data":""
381
384
}
385
+
```
382
386
383
387
Each python framework built its own request object, you may map its data to match what the saml toolkit expects.
"Error found on Metadata: %s"% (', '.join(errors))
455
+
print"Error found on Metadata: %s"% (', '.join(errors))
452
456
```
453
457
454
458
The get_sp_metadata will return the metadata signed or not based on the security info of the advanced_settings.json ('signMetadata').
@@ -476,7 +480,7 @@ if not errors:
476
480
else:
477
481
print'Not authenticated'
478
482
else:
479
-
"Error when processing SAML Response: %s"% (', '.join(errors))
483
+
print"Error when processing SAML Response: %s"% (', '.join(errors))
480
484
```
481
485
482
486
The SAML response is processed and then checked that there are no errors. It also verifies that the user is authenticated and stored the userdata in session.
@@ -489,6 +493,7 @@ At that point there are 2 possible alternatives:
489
493
Notice that we saved the user data in the session before the redirection to have the user data available at the RelayState view.
490
494
491
495
In order to retrieve attributes we use:
496
+
492
497
```python
493
498
attributes = auth.get_attributes();
494
499
```
@@ -509,11 +514,11 @@ If we execute print attributes we could get:
509
514
Each attribute name can be used as a key to obtain the value. Every attribute is a list of values. A single-valued attribute is a listy of a single element.
0 commit comments