Skip to content

Commit c9685a9

Browse files
authored
Merge pull request #655 from ksrnnb/update_readme
Update readme
2 parents 40ee918 + fe894e6 commit c9685a9

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,27 @@ IdpMetadataParser by its Entity Id value:
391391
)
392392
```
393393
394+
### Retrieve one Entity Descriptor with an specific binding and nameid format when several are available
395+
396+
If the Metadata contains several bindings and nameids, the relevant ones
397+
also can be specified when retrieving the settings from the IdpMetadataParser
398+
by the values of binding and nameid:
399+
400+
```ruby
401+
validate_cert = true
402+
options = {
403+
entity_id: "http//example.com/target/entity",
404+
name_id_format: "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress",
405+
sso_binding: "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST",
406+
slo_binding: "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
407+
}
408+
settings = idp_metadata_parser.parse_remote(
409+
"https://example.com/auth/saml2/idp/metadata",
410+
validate_cert,
411+
options
412+
)
413+
```
414+
394415
### Parsing Metadata into an Hash
395416
396417
The `OneLogin::RubySaml::IdpMetadataParser` also provides the methods `#parse_to_hash` and `#parse_remote_to_hash`.
@@ -406,7 +427,7 @@ but it can be done as follows:
406427
* Validate the Signature, providing the cert.
407428
* Provide the XML to the parse method if the signature was validated
408429
409-
```
430+
```ruby
410431
require "xml_security"
411432
require "onelogin/ruby-saml/utils"
412433
require "onelogin/ruby-saml/idp_metadata_parser"
@@ -440,7 +461,7 @@ if valid
440461
else
441462
print "Metadata Signarture failed to be verified with the cert provided"
442463
end
443-
464+
```
444465
445466
## Retrieving Attributes
446467

0 commit comments

Comments
 (0)