els_bootstrap 0.0.1 → 0.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.
- data/README.rdoc +29 -6
- data/app/controllers/els_session_controller.rb +10 -0
- data/lib/els_bootstrap/version.rb +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -29,14 +29,37 @@ _els_identity_ will not only result in a user cdid, but also their name, email a
|
|
29
29
|
|
30
30
|
== How to use it
|
31
31
|
|
32
|
-
|
32
|
+
*add the gem to your Gemfile
|
33
33
|
gem 'els_bootstrap', "~>0.0.1"
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
35
|
+
*tell the plugin about the openAM instance and the cookies it uses. In config/els_token.yml do something like this:
|
36
|
+
development:
|
37
|
+
uri: https://elsuat-sso.corp.aol.com:443/opensso/identity
|
38
|
+
cookie: iPlanetDirectoryProuat
|
39
|
+
production:
|
40
|
+
uri: https://els-sso.corp.aol.com:443/opensso/identity
|
41
|
+
cookie: iPlanetDirectoryPro
|
42
|
+
|
43
|
+
*call els_identity in your controller. Example:
|
44
|
+
class ApplicationController < ActionController::Base
|
45
|
+
before_filter :els_identity
|
46
|
+
end
|
47
|
+
|
48
|
+
If you do need to pull up an additional model, you might want to chain a before_filter. For example:
|
49
|
+
class ApplicationController < ActionController::Base
|
50
|
+
before_filter :els_identity,:my_model
|
51
|
+
|
52
|
+
def my_model
|
53
|
+
if @els_identity
|
54
|
+
@my_model ||= MyModel.find_by_name(@els_identity.name)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
== TODO
|
59
|
+
|
60
|
+
It would be nice to marshal an, optional, internal model automatically.
|
61
|
+
Generator for the els_token.yml config
|
39
62
|
|
40
63
|
== Contributing
|
41
64
|
Yes please.
|
42
|
-
fork, hack, send pull request :)
|
65
|
+
fork, hack, send pull request :)
|
@@ -90,5 +90,15 @@ class ElsSessionController < ApplicationController
|
|
90
90
|
redirect_to session[:redirect_to]
|
91
91
|
end
|
92
92
|
end
|
93
|
+
|
94
|
+
class ElsFaker < ElsToken::ElsIdentity
|
95
|
+
attr_accessor :cdid, :token_id
|
96
|
+
def initialize(cdid)
|
97
|
+
super
|
98
|
+
@cdid = cdid
|
99
|
+
@token_id = Random.rand
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
93
103
|
|
94
104
|
end
|