omniauth-workingnotworking 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +5 -0
- data/Gemfile +5 -0
- data/README.md +25 -0
- data/lib/omniauth-workingnotworking.rb +2 -0
- data/lib/omniauth-workingnotworking/version.rb +5 -0
- data/lib/omniauth/strategies/workingnotworking.rb +39 -0
- data/omniauth-workingnotworking.gemspec +23 -0
- metadata +93 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8069d1205646f392aa58a36301e140b679e5a839
|
4
|
+
data.tar.gz: 959cf2bcd71b0bb1fa944af1c7f55ef1943bead4
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6a206ed38150eb5912bdb5fb3e4fed023bf23570a1dc5b5f933462d87999c2adf2fae65135b9a0859d3d97714d8d5159fa33e878f8f21a0bd9b8e70d60dc0a9b
|
7
|
+
data.tar.gz: 52686e8dcd30f5eb081aacc1cac4998acff9aa4bd7dafc9d49aaf4de556d91bf272fb9c174eeed930d5e9a3b7ed7c087bb55ada5445d375807fda6c35f35f66f
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# OmniAuth Working Not Working
|
2
|
+
|
3
|
+
This strategy provides OAuth access to Working Not Working.
|
4
|
+
|
5
|
+
## Using This Strategy
|
6
|
+
|
7
|
+
First start by adding this gem to your Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'omniauth-workingnotworking'
|
11
|
+
```
|
12
|
+
|
13
|
+
If you need to use the latest HEAD version, you can do so with:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
gem 'omniauth-workingnotworking', :github => 'workingnotworking/omniauth-workingnotworking'
|
17
|
+
```
|
18
|
+
|
19
|
+
Next, tell OmniAuth about this provider. For a Rails app, your `config/initializers/omniauth.rb` file should look like this:
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
23
|
+
provider :workingnotworking, "APP_ID", "SECRET"
|
24
|
+
end
|
25
|
+
```
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'omniauth-oauth2'
|
2
|
+
|
3
|
+
module OmniAuth
|
4
|
+
module Strategies
|
5
|
+
class Workingnotworking < OmniAuth::Strategies::OAuth2
|
6
|
+
option :name, 'workingnotworking'
|
7
|
+
|
8
|
+
option :client_options, { :authorize_path => '/oauth/authorize',
|
9
|
+
:access_token_path => '/oauth/token',
|
10
|
+
:site => 'https://workingnotworking.com' }
|
11
|
+
|
12
|
+
uid { raw_info['id'].to_s }
|
13
|
+
|
14
|
+
info do
|
15
|
+
{
|
16
|
+
:first_name => raw_info['first_name'],
|
17
|
+
:last_name => raw_info['last_name'],
|
18
|
+
:email => raw_info['email'],
|
19
|
+
:username => raw_info['username'],
|
20
|
+
:current_login_at => raw_info['current_login_at'],
|
21
|
+
:created_at => raw_info['created_at'],
|
22
|
+
:updated_at => raw_info['updated_at'],
|
23
|
+
:avatar => raw_info['avatar']
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
def raw_info
|
28
|
+
@raw_info ||= access_token.get('/api/v1/account').parsed
|
29
|
+
rescue ::Errno::ETIMEDOUT
|
30
|
+
raise ::Timeout::Error
|
31
|
+
end
|
32
|
+
|
33
|
+
def callback_url
|
34
|
+
full_host + script_name + callback_path
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "omniauth-workingnotworking/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "omniauth-workingnotworking"
|
7
|
+
s.version = OmniAuth::Workingnotworking::VERSION
|
8
|
+
s.authors = ["Rob Cameron"]
|
9
|
+
s.email = ["rob@workingnotworking.com"]
|
10
|
+
s.homepage = "https://github.com/workingnotworking/omniauth-workingnotworking"
|
11
|
+
s.description = %q{OmniAuth strategy for Working Not Working}
|
12
|
+
s.summary = s.description
|
13
|
+
s.license = "MIT"
|
14
|
+
|
15
|
+
s.files = `git ls-files`.split("\n")
|
16
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
|
+
s.require_paths = ["lib"]
|
19
|
+
s.required_ruby_version = Gem::Requirement.new('>= 1.9.3')
|
20
|
+
s.add_dependency 'omniauth-oauth2', '~> 1.4'
|
21
|
+
s.add_dependency 'rack'
|
22
|
+
s.add_development_dependency 'bundler', '~> 1.0'
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,93 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: omniauth-workingnotworking
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Rob Cameron
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-04-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: omniauth-oauth2
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.4'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.4'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rack
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.0'
|
55
|
+
description: OmniAuth strategy for Working Not Working
|
56
|
+
email:
|
57
|
+
- rob@workingnotworking.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- Gemfile
|
64
|
+
- README.md
|
65
|
+
- lib/omniauth-workingnotworking.rb
|
66
|
+
- lib/omniauth-workingnotworking/version.rb
|
67
|
+
- lib/omniauth/strategies/workingnotworking.rb
|
68
|
+
- omniauth-workingnotworking.gemspec
|
69
|
+
homepage: https://github.com/workingnotworking/omniauth-workingnotworking
|
70
|
+
licenses:
|
71
|
+
- MIT
|
72
|
+
metadata: {}
|
73
|
+
post_install_message:
|
74
|
+
rdoc_options: []
|
75
|
+
require_paths:
|
76
|
+
- lib
|
77
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: 1.9.3
|
82
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
requirements: []
|
88
|
+
rubyforge_project:
|
89
|
+
rubygems_version: 2.6.11
|
90
|
+
signing_key:
|
91
|
+
specification_version: 4
|
92
|
+
summary: OmniAuth strategy for Working Not Working
|
93
|
+
test_files: []
|