Skip to content

Commit 927d6f0

Browse files
committed
docs: readme improvements
1 parent bbe39e9 commit 927d6f0

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

README.md

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![Rubygem Version](https://badge.fury.io/rb/ruby-saml.svg)](https://badge.fury.io/rb/ruby-saml)
55
[![GitHub version](https://badge.fury.io/gh/SAML-Toolkits%2Fruby-saml.svg)](https://badge.fury.io/gh/SAML-Toolkits%2Fruby-saml) ![GitHub](https://img.shields.io/github/license/SAML-Toolkits/ruby-saml) ![Gem](https://img.shields.io/gem/dtv/ruby-saml?label=gem%20downloads%20latest) ![Gem](https://img.shields.io/gem/dt/ruby-saml?label=gem%20total%20downloads)
66

7-
Ruby SAML minor and tiny versions may introduce breaking changes. Please read
7+
Minor and patch versions of Ruby SAML may introduce breaking changes. Please read
88
[UPGRADING.md](UPGRADING.md) for guidance on upgrading to new Ruby SAML versions.
99

1010
There is a critical vulnerability affecting ruby-saml < 1.17.0 (CVE-2024-45409). Make sure you are using an updated version. (1.12.3 is safe)
@@ -15,7 +15,7 @@ The Ruby SAML library is for implementing the client side of a SAML authorizatio
1515
i.e. it provides a means for managing authorization initialization and confirmation
1616
requests from identity providers.
1717

18-
SAML authorization is a two step process and you are expected to implement support for both.
18+
SAML authorization is a two-step process and you are expected to implement support for both.
1919

2020
We created a demo project for Rails 4 that uses the latest version of this library:
2121
[ruby-saml-example](https://github.com/saml-toolkits/ruby-saml-example)
@@ -34,7 +34,7 @@ The following Ruby versions are covered by CI testing:
3434
* Make your feature addition or bug fix
3535
* Add tests for your new features. This is important so we don't break any features in a future version unintentionally.
3636
* Ensure all tests pass by running `bundle exec rake test`.
37-
* Do not change rakefile, version, or history.
37+
* Do not change Rakefile, version, or history.
3838
* Open a pull request, following [this template](https://gist.github.com/Lordnibbler/11002759).
3939

4040
## Security Guidelines
@@ -45,20 +45,19 @@ by mail to the maintainer: [email protected]
4545
### Security Warning
4646

4747
Some tools may incorrectly report ruby-saml is a potential security vulnerability.
48-
ruby-saml depends on Nokogiri, and it's possible to use Nokogiri in a dangerous way
48+
ruby-saml depends on Nokogiri, and it is possible to use Nokogiri in a dangerous way
4949
(by enabling its DTDLOAD option and disabling its NONET option).
5050
This dangerous Nokogiri configuration, which is sometimes used by other components,
5151
can create an XML External Entity (XXE) vulnerability if the XML data is not trusted.
5252
However, ruby-saml never enables this dangerous Nokogiri configuration;
5353
ruby-saml never enables DTDLOAD, and it never disables NONET.
5454

55-
The OneLogin::RubySaml::IdpMetadataParser class does not validate in any way the URL
56-
that is introduced in order to be parsed.
55+
The OneLogin::RubySaml::IdpMetadataParser class does not validate the provided URL before parsing.
5756

58-
Usually, the same administrator that handles the Service Provider also sets the URL to
57+
Usually, the same administrator who handles the Service Provider also sets the URL to
5958
the IdP, which should be a trusted resource.
6059

61-
But there are other scenarios, like a SAAS app where the administrator of the app
60+
But there are other scenarios, like a SaaS app where the administrator of the app
6261
delegates this functionality to other users. In this case, extra precautions should
6362
be taken in order to validate such URL inputs and avoid attacks like SSRF.
6463

@@ -122,8 +121,8 @@ gem install nokogiri --version '~> 1.5.10'
122121
### Configuring Logging
123122

124123
When troubleshooting SAML integration issues, you will find it extremely helpful to examine the
125-
output of this gem's business logic. By default, log messages are emitted to RAILS_DEFAULT_LOGGER
126-
when the gem is used in a Rails context, and to STDOUT when the gem is used outside of Rails.
124+
output of this gem's business logic. By default, log messages are emitted to `RAILS_DEFAULT_LOGGER`
125+
when the gem is used in a Rails context, and to `STDOUT` when the gem is used outside of Rails.
127126
128127
To override the default behavior and control the destination of log messages, provide
129128
a ruby Logger object to the gem's logging singleton:
@@ -146,7 +145,7 @@ def init
146145
end
147146
```
148147
149-
If the SP knows who should be authenticated in the IdP, then can provide that info as follows:
148+
If the SP knows who should be authenticated in the IdP, it can provide that info as follows:
150149
151150
```ruby
152151
def init
@@ -224,7 +223,7 @@ def saml_settings
224223
end
225224
```
226225
227-
The use of settings.issuer is deprecated in favour of settings.sp_entity_id since version 1.11.0
226+
The use of `settings.issuer` is deprecated in favor of `settings.sp_entity_id` since version 1.11.0
228227
229228
Some assertion validations can be skipped by passing parameters to `OneLogin::RubySaml::Response.new()`.
230229
For example, you can skip the `AuthnStatement`, `Conditions`, `Recipient`, or the `SubjectConfirmation`
@@ -379,11 +378,11 @@ IdpMetadataParser by its Entity Id value:
379378
)
380379
```
381380
382-
### Retrieve one Entity Descriptor with an specific binding and nameid format when several are available
381+
### Retrieve one Entity Descriptor with a specific binding and nameid format when several are available
383382
384-
If the Metadata contains several bindings and nameids, the relevant ones
385-
also can be specified when retrieving the settings from the IdpMetadataParser
386-
by the values of binding and nameid:
383+
If the metadata contains multiple bindings and NameID formats, the relevant ones
384+
can be specified when retrieving the settings from the IdpMetadataParser
385+
by the values of binding and NameID:
387386
388387
```ruby
389388
validate_cert = true
@@ -447,13 +446,13 @@ if valid
447446
entity_id: "<entity_id_of_the_entity_to_be_retrieved>"
448447
)
449448
else
450-
print "Metadata Signarture failed to be verified with the cert provided"
449+
print "Metadata Signature failed to be verified with the cert provided"
451450
end
452451
```
453452
454453
## Retrieving Attributes
455454
456-
If you are using `saml:AttributeStatement` to transfer data like the username, you can access all the attributes through `response.attributes`. It contains all the `saml:AttributeStatement`s with its 'Name' as an indifferent key and one or more `saml:AttributeValue`s as values. The value returned depends on the value of the
455+
If you are using `saml:AttributeStatement` to transfer data, such as the username, you can access all the attributes through `response.attributes`. It contains all the `saml:AttributeStatement`s with its 'Name' as an indifferent key and one or more `saml:AttributeValue`s as values. The value returned depends on the value of the
457456
`single_value_compatibility` (when activated, only the first value is returned)
458457
459458
```ruby
@@ -676,7 +675,7 @@ Next, you may specify the specific SP SAML messages you would like to sign:
676675
settings.security[:logout_responses_signed] = true # Enable signature on Logout Response
677676
```
678677
679-
Signatures will be handled automatically for both `HTTP-Redirect` and `HTTP-Redirect` Binding.
678+
Signatures will be handled automatically for both `HTTP-Redirect` and `HTTP-POST` Binding.
680679
Note that the RelayState parameter is used when creating the Signature on the `HTTP-Redirect` Binding.
681680
Remember to provide it to the Signature builder if you are sending a `GET RelayState` parameter or the
682681
signature validation process will fail at the Identity Provider.
@@ -768,7 +767,7 @@ Note the following:
768767
#### Audience Validation
769768
770769
A service provider should only consider a SAML response valid if the IdP includes an <AudienceRestriction>
771-
element containting an <Audience> element that uniquely identifies the service provider. Unless you specify
770+
element containing an <Audience> element that uniquely identifies the service provider. Unless you specify
772771
the `skip_audience` option, Ruby SAML will validate that each SAML response includes an <Audience> element
773772
whose contents matches `settings.sp_entity_id`.
774773
@@ -946,7 +945,7 @@ end
946945
947946
## Attribute Service
948947
949-
To request attributes from the IdP the SP needs to provide an attribute service within it's metadata and reference the index in the assertion.
948+
To request attributes from the IdP the SP must provide an attribute service within its metadata and reference the index in the assertion.
950949
951950
```ruby
952951
settings = OneLogin::RubySaml::Settings.new
@@ -963,7 +962,7 @@ The `attribute_value` option additionally accepts an array of possible values.
963962
964963
## Custom Metadata Fields
965964
966-
Some IdPs may require to add SPs to add additional fields (Organization, ContactPerson, etc.)
965+
Some IdPs may require SPs to add additional fields (Organization, ContactPerson, etc.)
967966
into the SP metadata. This can be achieved by extending the `OneLogin::RubySaml::Metadata`
968967
class and overriding the `#add_extras` method as per the following example:
969968

0 commit comments

Comments
 (0)