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
+45-12Lines changed: 45 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,37 @@ The Ruby SAML library is for implementing the client side of a SAML authorizatio
9
9
10
10
SAML authorization is a two step process and you are expected to implement support for both.
11
11
12
-
## The initialization phase
12
+
## Getting Started
13
+
In order to use the toolkit you will need to install the gem (either manually or using Bundler), and require the library in your Ruby application:
14
+
15
+
Using `Gemfile`
16
+
17
+
```ruby
18
+
# latest stable
19
+
gem 'ruby-saml', '~> 0.8.1'
20
+
21
+
# or track master for bleeding-edge
22
+
gem 'ruby-saml', :github => 'onelogin/ruby-saml'
23
+
```
24
+
25
+
Using Bundler
26
+
27
+
```sh
28
+
gem install ruby-saml
29
+
```
30
+
31
+
When requiring the gem, you can add the whole toolkit
32
+
```ruby
33
+
require'onelogin/ruby-saml'
34
+
```
35
+
36
+
or just the required components individually:
37
+
38
+
```ruby
39
+
require'onelogin/ruby-saml/authrequest'
40
+
```
41
+
42
+
## The Initialization Phase
13
43
14
44
This is the first request you will get from the identity provider. It will hit your application at a specific URL (that you've announced as being your SAML initialization point). The response to this initialization, is a redirect back to the identity provider, which can look something like this (ignore the saml_settings method call for now):
# Optional. Describe according to IdP specification (if supported) which attributes the SP desires to receive in SAMLResponse.
90
123
settings.attributes_index =30
91
124
@@ -94,8 +127,8 @@ class SamlController < ApplicationController
94
127
end
95
128
```
96
129
97
-
If are using saml:AttributeStatement to transfare metadata, like the user name, you can access all the attributes through `response.attributes`. It
98
-
contains all the saml:AttributeStatement with its 'Name' as a indifferent key and the one saml:AttributeValue as value.
130
+
131
+
If are using saml:AttributeStatement to transfare metadata, like the user name, you can access all the attributes through `response.attributes`. It contains all the saml:AttributeStatement with its 'Name' as a indifferent key and the one saml:AttributeValue as value.
@@ -113,8 +146,8 @@ If we want to add a saml:AuthnContextDeclRef, define a `settings.authn_context_d
113
146
To form a trusted pair relationship with the IdP, the SP (you) need to provide metadata XML
114
147
to the IdP for various good reasons. (Caching, certificate lookups, relaying party permissions, etc)
115
148
116
-
The class OneLogin::RubySaml::Metadata takes care of this by reading the Settings and returning XML. All
117
-
you have to do is add a controller to return the data, then give this URL to the IdP administrator.
149
+
The class `OneLogin::RubySaml::Metadata` takes care of this by reading the Settings and returning XML. All you have to do is add a controller to return the data, then give this URL to the IdP administrator.
150
+
118
151
The metdata will be polled by the IdP every few minutes, so updating your settings should propagate
Make sure to keep the value as comfortably small as possible to keep security risks to a minimum.
145
178
146
-
## Note on Patches/Pull Requests
179
+
## Adding Features, Pull Requests
147
180
148
-
* Fork the project.
149
-
* Make your feature addition or bug fix.
150
-
* Add tests for it. This is important so I don't break it in a
151
-
future version unintentionally.
152
-
*Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
153
-
*Send me a pull request. Bonus points for topic branches.
181
+
* Fork the repository
182
+
* Make your feature addition or bug fix
183
+
* Add tests for your new features. This is important so we don't break any features in a future version unintentionally.
184
+
* Ensure all tests pass.
185
+
*Do not change rakefile, version, or history.
186
+
*Open a pull request, following [this template](https://gist.github.com/Lordnibbler/11002759).
0 commit comments