omniauth-misoca 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +25 -0
- data/Rakefile +10 -0
- data/lib/omniauth/misoca.rb +2 -0
- data/lib/omniauth/misoca/version.rb +5 -0
- data/lib/omniauth/strategies/misoca.rb +35 -0
- data/omniauth-misoca.gemspec +26 -0
- metadata +125 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f25ea55f4486a71e797cefd5e010b38850fe9d87
|
4
|
+
data.tar.gz: 44c17fe1a7ed77dee00926fc94ac9806e3544eae
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4b761d66fb25476cfd385ef4ab671e618ade610673efd27ae754959ccff8676b7e0ec9ecb62a3c4891bc757968d9569aa2fe31f357e5e5a8b618022bff205eb9
|
7
|
+
data.tar.gz: 2614a0f08ae6e499fbcd4d2dbb4353999acbf51ebafe66a8e265d48c3f8c8808dceeaab36c1cf96d9eb8a8e3a9cd0a8390df0801093e029c30e1972d4268ddef
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Hirofumi Wakasugi
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# Omniauth::Misoca
|
2
|
+
|
3
|
+
This is the OmniAuth strategy for authenticating to Misoca. To use it, you'll need to sign up for an OAuth2 Application ID and Secret on the Misoca API Page.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'omniauth-misoca'
|
11
|
+
```
|
12
|
+
|
13
|
+
## Basic Usage
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
use OmniAuth::Builder do
|
17
|
+
provider :misoca, ENV['MISOCA_KEY'], ENV['MISOCA_SECRET'], scope: 'write'
|
18
|
+
end
|
19
|
+
```
|
20
|
+
|
21
|
+
See http://doc.misoca.jp for details.
|
22
|
+
|
23
|
+
## License
|
24
|
+
|
25
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'omniauth-oauth2'
|
2
|
+
|
3
|
+
module OmniAuth
|
4
|
+
module Strategies
|
5
|
+
class Misoca < OmniAuth::Strategies::OAuth2
|
6
|
+
option :client_options,
|
7
|
+
site: 'https://app.misoca.jp',
|
8
|
+
authorize_url: 'https://app.misoca.jp/oauth2/authorize',
|
9
|
+
token_url: 'https://app.misoca.jp/oauth2/token'
|
10
|
+
|
11
|
+
uid do
|
12
|
+
raw_info['user_id'].to_s
|
13
|
+
end
|
14
|
+
|
15
|
+
info do
|
16
|
+
{
|
17
|
+
'email' => raw_info['email']
|
18
|
+
}
|
19
|
+
end
|
20
|
+
|
21
|
+
def raw_info
|
22
|
+
access_token.options[:mode] = :query
|
23
|
+
@raw_info ||= access_token.get('api/v1/me').parsed
|
24
|
+
end
|
25
|
+
|
26
|
+
# Overide callback_url to return the one w/o query string
|
27
|
+
# See https://github.com/intridea/omniauth-oauth2/pull/82
|
28
|
+
def callback_url
|
29
|
+
full_host + script_name + callback_path
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
OmniAuth.config.add_camelization 'misoca', 'Misoca'
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'omniauth/misoca/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "omniauth-misoca"
|
8
|
+
spec.version = Omniauth::Misoca::VERSION
|
9
|
+
spec.authors = ["Hirofumi Wakasugi"]
|
10
|
+
spec.email = ["baenej@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{OmniAuth strategy for Misoca.}
|
13
|
+
spec.description = %q{This is the OmniAuth strategy for authenticating to Misoca. To use it, you'll need to sign up for an OAuth2 Application ID and Secret on the Misoca API Page.}
|
14
|
+
spec.homepage = "https://github.com/5t111111/omniauth-misoca"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_runtime_dependency 'omniauth', '>= 1.3.1'
|
21
|
+
spec.add_runtime_dependency 'omniauth-oauth2', '>= 1.4.0'
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.12"
|
24
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
25
|
+
spec.add_development_dependency "minitest", "~> 5.0"
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: omniauth-misoca
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Hirofumi Wakasugi
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-05-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: omniauth
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.3.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.3.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: omniauth-oauth2
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.4.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.4.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.12'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.12'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: minitest
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '5.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '5.0'
|
83
|
+
description: This is the OmniAuth strategy for authenticating to Misoca. To use it,
|
84
|
+
you'll need to sign up for an OAuth2 Application ID and Secret on the Misoca API
|
85
|
+
Page.
|
86
|
+
email:
|
87
|
+
- baenej@gmail.com
|
88
|
+
executables: []
|
89
|
+
extensions: []
|
90
|
+
extra_rdoc_files: []
|
91
|
+
files:
|
92
|
+
- ".gitignore"
|
93
|
+
- Gemfile
|
94
|
+
- LICENSE.txt
|
95
|
+
- README.md
|
96
|
+
- Rakefile
|
97
|
+
- lib/omniauth/misoca.rb
|
98
|
+
- lib/omniauth/misoca/version.rb
|
99
|
+
- lib/omniauth/strategies/misoca.rb
|
100
|
+
- omniauth-misoca.gemspec
|
101
|
+
homepage: https://github.com/5t111111/omniauth-misoca
|
102
|
+
licenses:
|
103
|
+
- MIT
|
104
|
+
metadata: {}
|
105
|
+
post_install_message:
|
106
|
+
rdoc_options: []
|
107
|
+
require_paths:
|
108
|
+
- lib
|
109
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - ">="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '0'
|
114
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
requirements: []
|
120
|
+
rubyforge_project:
|
121
|
+
rubygems_version: 2.5.1
|
122
|
+
signing_key:
|
123
|
+
specification_version: 4
|
124
|
+
summary: OmniAuth strategy for Misoca.
|
125
|
+
test_files: []
|