Skip to content

Commit fe894e6

Browse files
committed
add how to specify binding/nameid
1 parent 3d6e8a3 commit fe894e6

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 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`.

0 commit comments

Comments
 (0)