rack-saml 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -90,13 +90,14 @@ Configuration to set SAML parameters. At least, you must configure saml_idp or s
90
90
  * *saml_sess_timeout*: SP session timeout (default: 1800 seconds)
91
91
  * *shib_app_id*: If you want to use the middleware as Shibboleth SP, you should specify an application ID. In the Shibboleth SP default configuration, 'default' is used as the application ID.
92
92
  * *shib_ds*: If you want to use the middleware as Shibboleth SP and use discovery service, specify the uri of the Discovery Service.
93
+ * *saml_sp*: Set the SAML SP's entity ID
93
94
  * *sp_cert*: path to the SAML SP's certificate file, e.g. cert.pem (AuthnRequest Signing and Response Encryption are not supported yet)
94
95
  * *sp_key*: path to the SAML SP's key file, e.g. key.pem (AuthnRequest Signing and Response Encryption are not supported yet)
95
96
 
96
- SAML SP's entity ID (saml_sp) is automatically generated from request URI and /rack-saml-sp (fixed path name). The Assertion Consumer Service URI is generated from request URI and protected_path.
97
+ If not set explicitly, SAML SP's entity ID (saml_sp) is automatically generated from request URI and /rack-saml-sp (fixed path name). The Assertion Consumer Service URI is generated from request URI and protected_path.
97
98
 
98
99
  saml_sp_prefix = "#{request.scheme}://#{request.host}#{":#{request.port}" if request.port}#{request.script_name}"
99
- @config['saml_sp'] = "#{saml_sp_prefix}/rack-saml-sp"
100
+ @config['saml_sp'] ||= "#{saml_sp_prefix}/rack-saml-sp"
100
101
  @config['assertion_consumer_service_uri'] = "#{saml_sp_prefix}#{@config['protected_path']}"
101
102
 
102
103
  **metadata.yml**
@@ -152,6 +153,21 @@ Add the following configuration after <rp:DefaultRelyingParty> in relying-party.
152
153
  <rp:ProfileConfiguration xsi:type="saml:SAML2SSOProfile" includeAttributeStatement="true" assertionLifetime="PT5M" assertionProxyCount="0" signResponses="never" signAssertions="always" encryptAssertions="never" encryptNameIds="never"/>
153
154
  </rp:RelyingParty>
154
155
 
156
+ ## Advanced Topics
157
+
158
+ ### Use with OmniAuth
159
+
160
+ You can connect rack-saml to omniauth-shibboleth. Basically, you do not need any specific configuration to use with omniauth-shibboleth.
161
+
162
+ ### Use with Devise
163
+
164
+ You can connect rack-saml to devise by using it together with omniauth and omniauth-shibboleth. The details of how to connect omniauth and devise are described in the following page:
165
+
166
+ OmniAuth: Overview
167
+ https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview
168
+
169
+ When you use omniauth with devise, the omniauth provider path becomes "/users/auth/shibboleth". So thus, you must set the *protected_path* parameter as "/users/auth/shibboleth/callback". After changing the configuration, you must also re-generate SP Metadata (/Shibboleth.sso/Metadata) and import it to IdP because *<AssertionConsumerService>* parameter in SP Metadata is generated by the *protected_path* parameter.
170
+
155
171
  ## TODO
156
172
 
157
173
  * write spec files
@@ -159,7 +175,7 @@ Add the following configuration after <rp:DefaultRelyingParty> in relying-party.
159
175
 
160
176
  ## License (MIT License)
161
177
 
162
- Copyright (C) 2011 by Toyokazu Akiyama.
178
+ rack-saml is released under the MIT license.
163
179
 
164
180
  Permission is hereby granted, free of charge, to any person obtaining a copy
165
181
  of this software and associated documentation files (the "Software"), to deal
data/lib/rack/saml.rb CHANGED
@@ -146,7 +146,7 @@ module Rack
146
146
  # saml_sp: SAML SP's entity_id
147
147
  # generate saml_sp from request uri and default path (rack-saml-sp)
148
148
  saml_sp_prefix = "#{request.scheme}://#{request.host}#{":#{request.port}" if request.port}#{request.script_name}"
149
- @config['saml_sp'] = "#{saml_sp_prefix}/rack-saml-sp"
149
+ @config['saml_sp'] ||= "#{saml_sp_prefix}/rack-saml-sp"
150
150
  @config['assertion_consumer_service_uri'] = "#{saml_sp_prefix}#{@config['protected_path']}"
151
151
  # for debug
152
152
  #return [
@@ -1,6 +1,6 @@
1
1
  require 'rack'
2
2
  module Rack
3
3
  module Saml
4
- VERSION = "0.0.4"
4
+ VERSION = "0.0.5"
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-saml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-14 00:00:00.000000000 Z
12
+ date: 2013-03-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ruby-saml
16
- requirement: &70289036886900 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: 0.5.2
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70289036886900
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 0.5.2
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: rspec
27
- requirement: &70289036886520 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,7 +37,12 @@ dependencies:
32
37
  version: '0'
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *70289036886520
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  description: SAML middleware for Rack (using ruby-saml)
37
47
  email:
38
48
  - toyokazu@gmail.com
@@ -99,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
109
  version: '0'
100
110
  requirements: []
101
111
  rubyforge_project:
102
- rubygems_version: 1.8.17
112
+ rubygems_version: 1.8.25
103
113
  signing_key:
104
114
  specification_version: 3
105
115
  summary: SAML middleware for Rack (using ruby-saml)