devise-stormpath 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
data/README.md
CHANGED
@@ -1,22 +1,50 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
1
|
+
[![Build Status](https://travis-ci.org/liquidautumn/devise-stormpath.png?branch=master)](https://travis-ci.org/liquidautumn/devise-stormpath)
|
2
|
+
[![Code Climate](https://codeclimate.com/github/liquidautumn/devise-stormpath.png)](https://codeclimate.com/github/liquidautumn/devise-stormpath)
|
3
|
+
|
4
|
+
# Stormpath authentication support for Devise
|
5
|
+
|
6
|
+
## Add gem reference to Gemfile
|
7
|
+
```ruby
|
8
|
+
gem "devise-stormpath"
|
9
|
+
```
|
10
|
+
|
11
|
+
## Setup stormpath-rails
|
12
|
+
Generate configuration file, then create directory per environment at stormpath and update stormpath.yml with corresponding directory hrefs.
|
13
|
+
```sh
|
14
|
+
rails g stormpath:rails:install
|
15
|
+
```
|
16
|
+
|
17
|
+
Generate and run migration, if you're on ActiveRecord. Skip this step for Mongoid.
|
18
|
+
```sh
|
19
|
+
rails g stormpath:rails:migration user
|
20
|
+
rake db:migrate
|
21
|
+
```
|
22
|
+
No need to include Stormpath::Rails::Account, it'll be done automatically.
|
23
|
+
|
24
|
+
## Configure Devise Modules
|
25
|
+
|
26
|
+
### Stormpath authentication
|
27
|
+
```ruby
|
28
|
+
devise :stormpath_authenticatable
|
29
|
+
```
|
30
|
+
Add user directory to application login sources, before trying to authenticate. Read more at https://www.stormpath.com/docs/console/product-guide#ManageLoginSources
|
31
|
+
|
32
|
+
### Registration
|
33
|
+
Default devise module works.
|
34
|
+
```ruby
|
35
|
+
devise :stormpath_authenticatable, :registerable
|
36
|
+
```
|
37
|
+
|
38
|
+
### Stormpath password reset
|
39
|
+
```ruby
|
40
|
+
devise :stormpath_authenticatable, :stormpath_recoverable
|
41
|
+
```
|
42
|
+
Setup Password Reset workflow (https://www.stormpath.com/docs/console/product-guide#PasswordReset)
|
43
|
+
Set Base URL to //{app host}/{devise scope}/password/edit (i.e. https://example.com/users/password/edit)
|
44
|
+
|
45
|
+
### Stormpath email verification
|
46
|
+
```ruby
|
47
|
+
devise :stormpath_authenticatable, :stormpath_confirmable
|
48
|
+
```
|
49
|
+
Setup Account Registration and Verification workflow (https://www.stormpath.com/docs/console/product-guide#AccountRegistration)
|
50
|
+
Set Base URL to //{app host}/{devise scope}/confirmation (i.e. https://example.com/users/confirmation)
|
data/devise-stormpath.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.require_paths = ["lib"]
|
18
18
|
|
19
19
|
s.add_dependency('devise')
|
20
|
-
s.add_dependency('stormpath-rails', '>= 0.4.
|
20
|
+
s.add_dependency('stormpath-rails', '>= 0.4.4')
|
21
21
|
s.add_dependency('activesupport')
|
22
22
|
|
23
23
|
s.add_development_dependency('rake', '~> 10.0.2')
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require "active_support/concern"
|
2
|
+
require "stormpath/rails/account"
|
2
3
|
|
3
4
|
module Devise
|
4
5
|
module Models
|
@@ -10,6 +11,7 @@ module Devise
|
|
10
11
|
end
|
11
12
|
|
12
13
|
included do
|
14
|
+
include ::Stormpath::Rails::Account
|
13
15
|
attr_accessor :password_confirmation, :password
|
14
16
|
attr_reader :current_password
|
15
17
|
end
|
@@ -4,6 +4,12 @@ require "devise/models/stormpath_authenticatable"
|
|
4
4
|
|
5
5
|
describe Devise::Models::StormpathAuthenticatable do
|
6
6
|
class User
|
7
|
+
class << self
|
8
|
+
%w{attr_accessible after_initialize before_create before_update after_destroy}.each do |method_name|
|
9
|
+
define_method method_name do |*args|
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
7
13
|
include Devise::Models::StormpathAuthenticatable
|
8
14
|
end
|
9
15
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise-stormpath
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: devise
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
requirements:
|
35
35
|
- - ! '>='
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: 0.4.
|
37
|
+
version: 0.4.4
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,7 +42,7 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 0.4.
|
45
|
+
version: 0.4.4
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: activesupport
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|