README.md in rails_sso-0.6.1 vs README.md in rails_sso-0.7.0
- old
+ new
@@ -33,10 +33,12 @@
```ruby
# conifg/initializers/sso.rb
RailsSso.configure do |config|
+ # include RailsSso::Helpers to ActionController::Base
+ config.magic_enabled = true
# url of entity provider
config.provider_url = 'https://example.com'
# name of oauth2 provider
config.provider_name = 'example'
# oauth keys for omniauth-example
@@ -48,13 +50,16 @@
config.provider_sign_out_path = '/api/v1/session'
# enable cache (will use Rails.cache store)
config.use_cache = Rails.application.config.action_controller.perform_caching
# test & development mode
config.test_mode = ENV['mock_sso']
- config.profile_mock = {
- user: 'John Blacksmith',
- uid: '169783'
+ config.access_token_mock = ENV['access_token_mock']
+ config.profiles_mock = {
+ '169783' => {
+ user: 'John Blacksmith',
+ uid: '169783'
+ }
}
# custom failure app
# more: https://github.com/hassox/warden/wiki/Failures
config.failure_app = MyFailureApp
end
@@ -70,10 +75,18 @@
end
```
## Usage
+Include helpers to your controller if you disabled auto include:
+
+```ruby
+class ApplicationController < ActionController::Base
+ include RailsSso::Helpers
+end
+```
+
Available helpers for controllers and views:
* `current_user_data`
* `user_signed_in?`
@@ -108,9 +121,11 @@
name: 'John Kowalski',
uid: '42'
}
end
```
+
+To mock signed out state set `profile_mock = nil`.
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)