Skip to content

Commit a1ba610

Browse files
author
jamesprior
committed
Updated notes for external user authentication
1 parent b5800ad commit a1ba610

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

doc/release_notes.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,14 @@ There is now a core API for handling users that are authenticated/authorized aga
188188

189189
A sample implementation of an authentication strategy can be found in lib/cms/authentication/test_password_strategy. Strategies are implemented as Devise Strategies and should either login or pass to the next strategy.
190190

191+
Don't forget to enable your new strategy in config/initializers/devise.rb
192+
```
193+
# Add test_password strategy BEFORE other CMS authentication strategies
194+
config.warden do |manager|
195+
manager.default_strategies(:scope => :cms_user).unshift :my_custom_strategy
196+
end
197+
```
198+
191199
This implementation is intended to replace CAS based strategies used in BrowserCMS 3.x. It provides the ability to style the login page directly, and avoid having an external CAS server software.
192200

193201
## Upgrading

lib/cms/authentication/test_password_strategy.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,13 @@ def authenticate!
1616
end
1717
end
1818

19-
Warden::Strategies.add(:test_password, Cms::Authentication::TestPasswordStrategy)
19+
Warden::Strategies.add(:test_password, Cms::Authentication::TestPasswordStrategy)
20+
21+
# NOTE: To enable a custom password strategy for BrowserCMS you must also add it to to the devise configuration.
22+
#
23+
# For example enable the test_password strategy above by adding the following to config/initializers/devise.rb
24+
25+
# # Add test_password strategy BEFORE other CMS authentication strategies
26+
# config.warden do |manager|
27+
# manager.default_strategies(:scope => :cms_user).unshift :test_password
28+
# end

0 commit comments

Comments
 (0)