sp-rails-saml 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 374e185b6d4b9e22ecef4416b1a055aa654909183f30200f9f279975a092931f
4
- data.tar.gz: c51814db83d99ed6df955fb96f3fb1ea8e028648670ef9ad98887c8ed07c900c
3
+ metadata.gz: 6a4c254224e4b68b35d60bca7c7e374889e4aa7f3bc30fb109f04a63560603d5
4
+ data.tar.gz: 658376899e39c2057a1bc3b3f01302f21f43af21e40c4cc797c962382d27655a
5
5
  SHA512:
6
- metadata.gz: 1627970cfb7b3627f29ac4b1939093bad85a1bd46169416066d054fec078f82dafdb75763dfdb48d8bfc2b132cd4a3757d5e01f75be48b3dfae1b3bb26092679
7
- data.tar.gz: 6ef81eece0dbf54117a22838f132007610a4d3a7f82dd41f76c57db6dd3754921f3d271de1029dfba55308d434a7218fcfeb1655173957c679d88abfbea46113
6
+ metadata.gz: d614e499f13a0027e94272bf0f73f4cb6ca68af5b8fa3fd362b1be85db8bfc6e507adeff371dfe2fd54a34548909fc969f04576b320340d07c8f2853f0065e64
7
+ data.tar.gz: 0d8ea7ce7eba68f54f5f3a84791dcdc1dc7e92875fd48023a0b96ed1b76d57239348fc9e054a5b3b3d94e50eb43731e7c2da8fb3f376b3aab78a075fef6c0ed6
data/README.md CHANGED
@@ -50,6 +50,13 @@ $ rails g sp_rails_saml:install {reference_table_name}
50
50
  At this point, you need to write your account table name in `reference_table_name`.
51
51
  This will generate the saml templates for controller, view, model, initializer, etc.
52
52
 
53
+
54
+ If you need only saml sp initiated and idp initiated template
55
+
56
+ ```
57
+ $ rails g sp_rails_saml:install {reference_table_name} --settings false
58
+ ```
59
+
53
60
  **Controller**
54
61
  - [app/controllers/saml/sessions_controller.rb](https://github.com/metaps/sp-rails-saml/blob/develop/lib/generators/sp-rails-saml/templates/controllers/sessions_controller.rb)
55
62
  - [app/controllers/saml/ssos_controller.rb](https://github.com/metaps/sp-rails-saml/blob/develop/lib/generators/sp-rails-saml/templates/controllers/sessions_controller.rb)
@@ -72,15 +79,24 @@ To configure routings for above templates, just add the following line to your
72
79
 
73
80
  ```ruby
74
81
  sp_rails_saml_routes
82
+
83
+ # if you need only saml sp initiated and idp initiated routing
84
+ sp_rails_saml_routes(sso_only: true)
75
85
  ```
76
86
 
77
87
  This routing method encompasses the following endpoints:
78
88
 
79
89
  ```
80
- GET /saml/metadata/:id
81
- POST /saml/sso/:id
90
+ # metadata url
91
+ GET /saml/sp/metadata/:id
82
92
 
93
+ # acs url
94
+ POST /saml/sp/consume/:id
95
+
96
+ # saml login page
83
97
  GET /saml/sign_in
98
+
99
+ # start saml sp initiated
84
100
  POST /saml/sign_in
85
101
 
86
102
  GET /saml/saml_settings
@@ -116,6 +132,11 @@ skip_before_action :authenticate_user!
116
132
  You need to add the follwing line to your `ApplicationController`:
117
133
 
118
134
  ```ruby
135
+ def sign_in_with_saml(user)
136
+ # add create session logic
137
+ end
138
+
139
+ # using devise example
119
140
  def sign_in_with_saml(user)
120
141
  sign_in(:user, user)
121
142
  redirect_to root_path
@@ -126,6 +147,15 @@ end
126
147
 
127
148
  Once the above process is complete, you can edit your saml credentials in `/saml/saml_settings/edit`.
128
149
 
150
+
151
+ ## Check Saml Value
152
+
153
+ sp-rails-saml only validate below list value
154
+
155
+ - SAML Response AudienceRestriction
156
+ - SAML Response Signature
157
+ - SAML Response Destination
158
+
129
159
  ## :page_facing_up: License
130
160
 
131
161
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -4,7 +4,7 @@ module Saml
4
4
  class SsosBaseController < SamlBaseController
5
5
  skip_forgery_protection only: %w[consume]
6
6
 
7
- # POST /saml/metadata/:id
7
+ # POST /saml/sp/consume/:id
8
8
  def consume
9
9
  setting = SpRailsSaml::Settings.instance
10
10
  account = setting.account_class.find_by!(setting.account_find_key => params[setting.account_find_key])
@@ -16,14 +16,14 @@ module Saml
16
16
 
17
17
  raise SpRailsSaml::SamlResponseInvalid, saml_response.errors unless saml_response.valid?
18
18
 
19
- user = setting.user_class.find_by(setting.saml_response_user_find_key => saml_response.name_id)
19
+ user = setting.user_class.find_by(setting.saml_response_user_find_key => saml_response.name_id, setting.account_class.to_s.downcase => account)
20
20
 
21
21
  raise SpRailsSaml::LoginUserNotFound if user.blank?
22
22
 
23
23
  sign_in_with_saml(user)
24
24
  end
25
25
 
26
- # GET /saml/metadata/:id
26
+ # GET /saml/sp/metadata/:id
27
27
  def metadata
28
28
  setting = SpRailsSaml::Settings.instance
29
29
  account = setting.account_class.find_by!(setting.account_find_key => params[setting.account_find_key])
@@ -2,12 +2,12 @@
2
2
 
3
3
  module Saml
4
4
  class SsosController < SsosBaseController
5
- # POST /saml/sso/:id
5
+ # POST /saml/sp/consume/:id
6
6
  # def consume
7
7
  # super
8
8
  # end
9
9
 
10
- # GET /saml/metadata/:id
10
+ # GET /saml/sp/metadata/:id
11
11
  # def metadata
12
12
  # super
13
13
  # end
@@ -1,3 +1,3 @@
1
1
  module SpRailsSaml
2
- VERSION = '1.0.1'.freeze
2
+ VERSION = '1.0.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sp-rails-saml
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - psyashes
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-07-06 00:00:00.000000000 Z
12
+ date: 2021-10-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ruby-saml
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0'
85
85
  requirements: []
86
- rubygems_version: 3.1.4
86
+ rubygems_version: 3.0.3
87
87
  signing_key:
88
88
  specification_version: 4
89
89
  summary: Simple sp saml for rails.