Skip to content

Commit 8445fc6

Browse files
committed
Fix doc
1 parent e2e38b9 commit 8445fc6

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ SAML requires a x.509 cert to sign and encrypt elements like NameID, Message, As
118118

119119
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:
120120

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
123123

124124
Or also we can provide those data in the setting file at the 'x509cert' and the privateKey' json parameters of the 'sp' element.
125125

@@ -247,6 +247,7 @@ This is the settings.json file:
247247

248248
In addition to the required settings data (idp, sp), there is extra information that could be defined at advanced_settings.json
249249

250+
```javascript
250251
{
251252
// Security settings
252253
"security": {
@@ -315,6 +316,7 @@ In addition to the required settings data (idp, sp), there is extra information
315316
}
316317
}
317318
}
319+
```
318320

319321
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.
320322

@@ -365,6 +367,7 @@ from onelogin.saml2.utils import OneLogin_Saml2_Utils
365367
#### The Request ####
366368

367369
Building an OneLogin_Saml2_Auth object requires a 'request' parameter.
370+
368371
```python
369372
auth = OneLogin_Saml2_Auth(req)
370373
```
@@ -379,9 +382,10 @@ req = {
379382
"get_data": "",
380383
"post_data": ""
381384
}
385+
```
382386

383387
Each python framework built its own request object, you may map its data to match what the saml toolkit expects.
384-
Let's see some examples:
388+
Let`s see some examples:
385389

386390
```python
387391
def prepare_from_django_request(request):
@@ -448,7 +452,7 @@ errors = saml_settings.validate_metadata(metadata)
448452
if len(errors) == 0:
449453
print metadata
450454
else:
451-
"Error found on Metadata: %s" % (', '.join(errors))
455+
print "Error found on Metadata: %s" % (', '.join(errors))
452456
```
453457

454458
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:
476480
else:
477481
print 'Not authenticated'
478482
else:
479-
"Error when processing SAML Response: %s" % (', '.join(errors))
483+
print "Error when processing SAML Response: %s" % (', '.join(errors))
480484
```
481485

482486
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:
489493
Notice that we saved the user data in the session before the redirection to have the user data available at the RelayState view.
490494

491495
In order to retrieve attributes we use:
496+
492497
```python
493498
attributes = auth.get_attributes();
494499
```
@@ -509,11 +514,11 @@ If we execute print attributes we could get:
509514
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.
510515

511516
The following code is equivalent:
517+
512518
```python
513519
attributes = auth.get_attributes();
514520
print attributes['cn']
515521

516-
517522
print auth.get_attribute('cn')
518523
```
519524

0 commit comments

Comments
 (0)