omniauth-pam 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Vagrantfile +15 -0
- data/example/Gemfile +6 -0
- data/example/Procfile +1 -0
- data/example/README.md +22 -0
- data/example/app.rb +33 -0
- data/example/config.ru +6 -0
- data/lib/omniauth-pam/version.rb +1 -1
- data/lib/omniauth/strategies/pam.rb +3 -1
- metadata +61 -70
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: af3fd0f82b596952bb68609a7a6a58fff1cdc374
|
4
|
+
data.tar.gz: ea13e98427607e8eda92559493577f21fbcb8653
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 74fa66c8a34ee8377212413e15c7cdefb3efd74c5408309b623a6df66879e82127c9bd2cbb5dccfe607826f3b9e0508052246b083acc77cea977fcd6f9e352ec
|
7
|
+
data.tar.gz: 475d096738a732439c3df8e72dc4acb5d9ccf85583918cd056b91f071dbdc6d3d080b1af67dd04d5b2c0a0b9490d427b8459d28eac78a486ac1fc60440fa74f2
|
data/Vagrantfile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# -*- mode: ruby -*-
|
2
|
+
# vi: set ft=ruby :
|
3
|
+
|
4
|
+
Vagrant.configure('2') do |config|
|
5
|
+
config.vm.hostname = 'omniauth-pam'
|
6
|
+
config.vm.box = 'boxes-wheezy64-chef'
|
7
|
+
config.vm.box_url = 'http://boxes.nickcharlton.net/wheezy64-chef-virtualbox.box'
|
8
|
+
|
9
|
+
# forward a port for testing
|
10
|
+
config.vm.network "forwarded_port", guest: 5000, host: 8080, auto_correct: true
|
11
|
+
|
12
|
+
# ensure the basic packages exist to get it all working
|
13
|
+
config.vm.provision 'shell', inline: 'sudo apt-get -yqq install git libpam0g-dev;'\
|
14
|
+
'sudo gem install bundler foreman'
|
15
|
+
end
|
data/example/Gemfile
ADDED
data/example/Procfile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
web: bundle exec unicorn -p $PORT
|
data/example/README.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# omniauth-pam example
|
2
|
+
|
3
|
+
This is a very simple example to demonstrate how OmniAuth::PAM can be used within a
|
4
|
+
primitive [Sinatra][] application.
|
5
|
+
|
6
|
+
You can start it by doing:
|
7
|
+
|
8
|
+
```bash
|
9
|
+
[sudo] gem install bundler foreman
|
10
|
+
bundle install
|
11
|
+
foreman start
|
12
|
+
```
|
13
|
+
|
14
|
+
Preferably from within the Vagrantfile included in the root of the repository.
|
15
|
+
|
16
|
+
## Usage
|
17
|
+
|
18
|
+
1. Go to http://localhost:5000
|
19
|
+
2. You'll be redirected to a login page.
|
20
|
+
3. Enter a system user account (for example: vagrant/vagrant).
|
21
|
+
4. Then, you'll be redirected to another page listing the auth hash details.
|
22
|
+
|
data/example/app.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
class App < Sinatra::Base
|
2
|
+
use Rack::Session::Cookie
|
3
|
+
use OmniAuth::Strategies::PAM
|
4
|
+
|
5
|
+
helpers do
|
6
|
+
def ensure_auth
|
7
|
+
unless session[:auth]
|
8
|
+
redirect '/auth/pam'
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
get '/' do
|
14
|
+
ensure_auth
|
15
|
+
end
|
16
|
+
|
17
|
+
# OmniAuth support
|
18
|
+
post '/auth/:name/callback' do
|
19
|
+
auth = request.env['omniauth.auth']
|
20
|
+
puts auth
|
21
|
+
|
22
|
+
<<-HTML
|
23
|
+
<h1>Authenticated via #{auth[:provider]}.</h1>
|
24
|
+
|
25
|
+
<ul>
|
26
|
+
<li>name: #{auth.info[:name]}</li>
|
27
|
+
<li>nickname: #{auth.info[:nickname]}</li>
|
28
|
+
<li>email: #{auth.info[:email]}</li>
|
29
|
+
<li>uid: #{auth[:uid]}</li>
|
30
|
+
</ul>
|
31
|
+
HTML
|
32
|
+
end
|
33
|
+
end
|
data/example/config.ru
ADDED
data/lib/omniauth-pam/version.rb
CHANGED
@@ -3,6 +3,7 @@ module OmniAuth
|
|
3
3
|
class PAM
|
4
4
|
include OmniAuth::Strategy
|
5
5
|
|
6
|
+
option :name, 'pam'
|
6
7
|
option :fields, [:username]
|
7
8
|
option :uid_field, :username
|
8
9
|
|
@@ -47,7 +48,8 @@ module OmniAuth
|
|
47
48
|
info do
|
48
49
|
{
|
49
50
|
:nickname => uid,
|
50
|
-
:name => uid
|
51
|
+
:name => uid,
|
52
|
+
:email => "#{uid}#{ options.has_key?(:email) ? options[:email] : ''}"
|
51
53
|
}.merge!(parse_gecos)
|
52
54
|
end
|
53
55
|
end
|
metadata
CHANGED
@@ -1,108 +1,99 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-pam
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
segments:
|
6
|
-
- 1
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
version: 1.1.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.2.0
|
10
5
|
platform: ruby
|
11
|
-
authors:
|
6
|
+
authors:
|
12
7
|
- Nick Charlton
|
13
8
|
autorequire:
|
14
9
|
bindir: bin
|
15
10
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2013-11-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
21
14
|
name: omniauth
|
22
|
-
|
23
|
-
|
24
|
-
requirements:
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
25
17
|
- - ~>
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
|
28
|
-
- 1
|
29
|
-
- 0
|
30
|
-
version: "1.0"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
31
20
|
type: :runtime
|
32
|
-
version_requirements: *id001
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: rpam-ruby19
|
35
21
|
prerelease: false
|
36
|
-
|
37
|
-
requirements:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rpam-ruby19
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
38
31
|
- - ~>
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
segments:
|
41
|
-
- 1
|
42
|
-
- 2
|
43
|
-
- 1
|
32
|
+
- !ruby/object:Gem::Version
|
44
33
|
version: 1.2.1
|
45
34
|
type: :runtime
|
46
|
-
version_requirements: *id002
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: etc
|
49
35
|
prerelease: false
|
50
|
-
|
51
|
-
requirements:
|
52
|
-
- -
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
|
55
|
-
|
56
|
-
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.2.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: etc
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
57
48
|
type: :runtime
|
58
|
-
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
59
55
|
description: A PAM strategy for OmniAuth.
|
60
|
-
email:
|
56
|
+
email:
|
61
57
|
- hello@nickcharlton.net
|
62
58
|
executables: []
|
63
|
-
|
64
59
|
extensions: []
|
65
|
-
|
66
60
|
extra_rdoc_files: []
|
67
|
-
|
68
|
-
files:
|
61
|
+
files:
|
69
62
|
- .gitignore
|
70
63
|
- Gemfile
|
71
64
|
- README.md
|
72
65
|
- Rakefile
|
66
|
+
- Vagrantfile
|
67
|
+
- example/Gemfile
|
68
|
+
- example/Procfile
|
69
|
+
- example/README.md
|
70
|
+
- example/app.rb
|
71
|
+
- example/config.ru
|
73
72
|
- lib/omniauth-pam.rb
|
74
73
|
- lib/omniauth-pam/version.rb
|
75
74
|
- lib/omniauth/strategies/pam.rb
|
76
75
|
- omniauth-pam.gemspec
|
77
|
-
has_rdoc: true
|
78
76
|
homepage: https://github.com/nickcharlton/omniauth-pam
|
79
77
|
licenses: []
|
80
|
-
|
78
|
+
metadata: {}
|
81
79
|
post_install_message:
|
82
80
|
rdoc_options: []
|
83
|
-
|
84
|
-
require_paths:
|
81
|
+
require_paths:
|
85
82
|
- lib
|
86
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
87
|
-
requirements:
|
88
|
-
- -
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
- !ruby/object:Gem::Version
|
97
|
-
segments:
|
98
|
-
- 0
|
99
|
-
version: "0"
|
83
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - '>='
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
100
93
|
requirements: []
|
101
|
-
|
102
94
|
rubyforge_project: omniauth-pam
|
103
|
-
rubygems_version:
|
95
|
+
rubygems_version: 2.0.3
|
104
96
|
signing_key:
|
105
|
-
specification_version:
|
97
|
+
specification_version: 4
|
106
98
|
summary: A PAM strategy for OmniAuth.
|
107
99
|
test_files: []
|
108
|
-
|