omniauth-vipps 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +5 -1
- data/Gemfile +1 -1
- data/README.md +63 -60
- data/lib/omniauth/strategies/vipps.rb +1 -1
- data/lib/omniauth/strategies/vipps_test.rb +1 -1
- data/lib/omniauth-vipps/version.rb +1 -1
- metadata +3 -9
- data/Gemfile.lock +0 -146
- data/bin/console +0 -11
- data/bin/setup +0 -8
- data/lib/omniauth-vipps/.DS_Store +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 427a035d7acd8eee313c79b2000650380e1983c4f7529ba0f4e79026f738139b
|
4
|
+
data.tar.gz: 8edc21d20685a9e5a390280ba07914912a40d5da1f3f1131b4d665672e81800b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac1f5fb7e3cab5193abc76ae0b79bd8a828429e19d97849e6906b73f659500fa17edffe34ed9c09b32b29b9fe0934aec7d2bb2e4d4a9476a0b9c007a062f8e26
|
7
|
+
data.tar.gz: '080d6d7357c837eeab973690b5adb874f24296b65f682ede9dd3dfea764b4f240c7f61dcead4958cb805d0e19a3ab175a496862445f90bbae5099f6a1833b4d7'
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,76 +1,79 @@
|
|
1
|
-
# OmniAuth
|
1
|
+
# OmniAuth Vipps
|
2
2
|
|
3
|
-
[![Gem Version](http://img.shields.io/gem/v/omniauth-
|
4
|
-
[![Code Climate](http://img.shields.io/codeclimate/maintainability/
|
5
|
-
[![Coverage Status](http://img.shields.io/coveralls/
|
6
|
-
[![Security](https://hakiri.io/github/omniauth/omniauth-
|
3
|
+
[![Gem Version](http://img.shields.io/gem/v/omniauth-vipps.svg)][gem]
|
4
|
+
[![Code Climate](http://img.shields.io/codeclimate/maintainability/maxig/omniauth-vipps.svg)][codeclimate]
|
5
|
+
[![Coverage Status](http://img.shields.io/coveralls/maxig/omniauth-vipps.svg)][coveralls]
|
6
|
+
[![Security](https://hakiri.io/github/omniauth/omniauth-vipps/master.svg)](https://hakiri.io/github/omniauth/omniauth-vipps/master)
|
7
7
|
|
8
|
-
[gem]: https://rubygems.org/gems/omniauth-
|
9
|
-
[codeclimate]: https://codeclimate.com/github/
|
10
|
-
[coveralls]: https://coveralls.io/r/
|
8
|
+
[gem]: https://rubygems.org/gems/omniauth-vipps
|
9
|
+
[codeclimate]: https://codeclimate.com/github/maxig/omniauth-vipps
|
10
|
+
[coveralls]: https://coveralls.io/r/maxig/omniauth-vipps
|
11
11
|
|
12
|
-
This gem contains a
|
13
|
-
|
14
|
-
|
12
|
+
This gem contains a Oauth2 strategy for VIPPS. It is meant to serve
|
13
|
+
the login functionality to allow a secure authentication. To
|
14
|
+
use it, you'll need to sign up for an OAuth2 Client ID and Client Secret
|
15
|
+
on the [Vipps Development portal](https://portal.vipps.no).
|
15
16
|
|
16
|
-
##
|
17
|
+
## Installation
|
17
18
|
|
18
|
-
|
19
|
-
|
19
|
+
```ruby
|
20
|
+
gem 'omniauth-vipps', '~> 1.0.0'
|
21
|
+
```
|
22
|
+
|
23
|
+
## Basic Usage
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
use OmniAuth::Builder do
|
27
|
+
provider :vipps, ENV['VIPPS_CLEINT_ID'], ENV['VIPPS_CLIENT_SECRET']
|
28
|
+
end
|
29
|
+
```
|
30
|
+
|
31
|
+
## Basic Usage - Rails
|
32
|
+
|
33
|
+
In `config/initializers/vipps.rb`
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
37
|
+
provider :vipps, ENV['VIPPS_CLEINT_ID'], ENV['VIPPS_CLIENT_SECRET']
|
38
|
+
end
|
39
|
+
```
|
40
|
+
|
41
|
+
## Basic Usage - Devise
|
42
|
+
|
43
|
+
NOTE: When using Devise, ignore Basic Usage altogether. Otherwise, you might run into problems of defining a strategy several times.
|
44
|
+
In `config/initializers/devise.rb`
|
20
45
|
|
21
46
|
```ruby
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
class SomeSite < OmniAuth::Strategies::OAuth2
|
27
|
-
# Give your strategy a name.
|
28
|
-
option :name, "some_site"
|
29
|
-
|
30
|
-
# This is where you pass the options you would pass when
|
31
|
-
# initializing your consumer from the OAuth gem.
|
32
|
-
option :client_options, {:site => "https://api.somesite.com"}
|
33
|
-
|
34
|
-
# You may specify that your strategy should use PKCE by setting
|
35
|
-
# the pkce option to true: https://tools.ietf.org/html/rfc7636
|
36
|
-
option :pkce, true
|
37
|
-
|
38
|
-
# These are called after authentication has succeeded. If
|
39
|
-
# possible, you should try to set the UID without making
|
40
|
-
# additional calls (if the user id is returned with the token
|
41
|
-
# or as a URI parameter). This may not be possible with all
|
42
|
-
# providers.
|
43
|
-
uid{ raw_info['id'] }
|
44
|
-
|
45
|
-
info do
|
46
|
-
{
|
47
|
-
:name => raw_info['name'],
|
48
|
-
:email => raw_info['email']
|
49
|
-
}
|
50
|
-
end
|
51
|
-
|
52
|
-
extra do
|
53
|
-
{
|
54
|
-
'raw_info' => raw_info
|
55
|
-
}
|
56
|
-
end
|
57
|
-
|
58
|
-
def raw_info
|
59
|
-
@raw_info ||= access_token.get('/me').parsed
|
60
|
-
end
|
61
|
-
end
|
47
|
+
Devise.setup do |config|
|
48
|
+
...
|
49
|
+
config.omniauth :vipps, ENV['VIPPS_CLEINT_ID'], ENV['VIPPS_CLIENT_SECRET']
|
50
|
+
...
|
62
51
|
end
|
52
|
+
```
|
53
|
+
|
54
|
+
## Scopes
|
55
|
+
|
56
|
+
Vipps Login API lets you set scopes to provide granular access to different types of data:
|
57
|
+
|
58
|
+
```ruby
|
59
|
+
use OmniAuth::Builder do
|
60
|
+
provider :vipps, ENV['VIPPS_CLEINT_ID'], ENV['VIPPS_CLIENT_SECRET'], scope: "openid email"
|
63
61
|
end
|
64
62
|
```
|
65
63
|
|
66
|
-
|
64
|
+
More info on [Scopes](https://developer.vippsmobilepay.com/docs/APIs/login-api/api-guide/core-concepts/#scopes).
|
65
|
+
|
66
|
+
|
67
|
+
## Semver
|
68
|
+
This project adheres to Semantic Versioning 2.0.0. Any violations of this scheme are considered to be bugs.
|
69
|
+
All changes will be tracked [here](https://github.com/omniauth/omniauth-github/releases).
|
67
70
|
|
68
|
-
##
|
71
|
+
## License
|
69
72
|
|
70
|
-
|
73
|
+
Copyright (c) 2011 Max Gordienok and Goscore AS.
|
71
74
|
|
72
|
-
|
75
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
73
76
|
|
74
|
-
|
77
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
75
78
|
|
76
|
-
|
79
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -6,7 +6,7 @@ module OmniAuth
|
|
6
6
|
# Main class for Vipps OAuth2 strategy.
|
7
7
|
class Vipps < OmniAuth::Strategies::OAuth2
|
8
8
|
DEFAULT_SCOPE = 'openid name phoneNumber address birthDate email'
|
9
|
-
BASE_URL = 'https://
|
9
|
+
BASE_URL = 'https://api.vipps.no'
|
10
10
|
USER_INFO_URL = '/vipps-userinfo-api/userinfo/'
|
11
11
|
|
12
12
|
option :name, 'vipps'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-vipps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maksim Hardziyenak
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|
@@ -55,9 +55,7 @@ dependencies:
|
|
55
55
|
description: Vipps Mobilepay OmniAuth Strategy for Login
|
56
56
|
email:
|
57
57
|
- aikismax@gmail.com
|
58
|
-
executables:
|
59
|
-
- console
|
60
|
-
- setup
|
58
|
+
executables: []
|
61
59
|
extensions: []
|
62
60
|
extra_rdoc_files: []
|
63
61
|
files:
|
@@ -68,14 +66,10 @@ files:
|
|
68
66
|
- CHANGELOG.md
|
69
67
|
- CODE_OF_CONDUCT.md
|
70
68
|
- Gemfile
|
71
|
-
- Gemfile.lock
|
72
69
|
- LICENSE.txt
|
73
70
|
- README.md
|
74
71
|
- Rakefile
|
75
|
-
- bin/console
|
76
|
-
- bin/setup
|
77
72
|
- lib/omniauth-vipps.rb
|
78
|
-
- lib/omniauth-vipps/.DS_Store
|
79
73
|
- lib/omniauth-vipps/version.rb
|
80
74
|
- lib/omniauth/strategies/vipps.rb
|
81
75
|
- lib/omniauth/strategies/vipps_test.rb
|
data/Gemfile.lock
DELETED
@@ -1,146 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
omniauth-vipps (1.0.0)
|
5
|
-
omniauth-oauth2 (~> 1.8)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: https://rubygems.org/
|
9
|
-
specs:
|
10
|
-
addressable (2.3.8)
|
11
|
-
ast (2.4.2)
|
12
|
-
base64 (0.2.0)
|
13
|
-
bigdecimal (3.1.7)
|
14
|
-
coveralls_reborn (0.19.0)
|
15
|
-
simplecov (>= 0.18.1, < 0.21.0)
|
16
|
-
term-ansicolor (~> 1.6)
|
17
|
-
thor (>= 0.20.3, < 2.0)
|
18
|
-
tins (~> 1.16)
|
19
|
-
crack (1.0.0)
|
20
|
-
bigdecimal
|
21
|
-
rexml
|
22
|
-
diff-lcs (1.5.1)
|
23
|
-
docile (1.4.0)
|
24
|
-
domain_name (0.6.20240107)
|
25
|
-
faraday (2.9.0)
|
26
|
-
faraday-net_http (>= 2.0, < 3.2)
|
27
|
-
faraday-net_http (3.1.0)
|
28
|
-
net-http
|
29
|
-
hashdiff (1.1.0)
|
30
|
-
hashie (5.0.0)
|
31
|
-
http-cookie (1.0.5)
|
32
|
-
domain_name (~> 0.5)
|
33
|
-
json (2.7.1)
|
34
|
-
jwt (2.8.1)
|
35
|
-
base64
|
36
|
-
language_server-protocol (3.17.0.3)
|
37
|
-
mime-types (1.25.1)
|
38
|
-
multi_xml (0.6.0)
|
39
|
-
net-http (0.4.1)
|
40
|
-
uri
|
41
|
-
netrc (0.11.0)
|
42
|
-
oauth2 (2.0.9)
|
43
|
-
faraday (>= 0.17.3, < 3.0)
|
44
|
-
jwt (>= 1.0, < 3.0)
|
45
|
-
multi_xml (~> 0.5)
|
46
|
-
rack (>= 1.2, < 4)
|
47
|
-
snaky_hash (~> 2.0)
|
48
|
-
version_gem (~> 1.1)
|
49
|
-
omniauth (2.1.2)
|
50
|
-
hashie (>= 3.4.6)
|
51
|
-
rack (>= 2.2.3)
|
52
|
-
rack-protection
|
53
|
-
omniauth-oauth2 (1.8.0)
|
54
|
-
oauth2 (>= 1.4, < 3)
|
55
|
-
omniauth (~> 2.0)
|
56
|
-
parallel (1.24.0)
|
57
|
-
parser (3.3.0.5)
|
58
|
-
ast (~> 2.4.1)
|
59
|
-
racc
|
60
|
-
racc (1.7.3)
|
61
|
-
rack (3.0.10)
|
62
|
-
rack-protection (4.0.0)
|
63
|
-
base64 (>= 0.1.0)
|
64
|
-
rack (>= 3.0.0, < 4)
|
65
|
-
rack-test (2.1.0)
|
66
|
-
rack (>= 1.3)
|
67
|
-
rainbow (3.1.1)
|
68
|
-
rake (13.1.0)
|
69
|
-
regexp_parser (2.9.0)
|
70
|
-
rest-client (1.8.0)
|
71
|
-
http-cookie (>= 1.0.2, < 2.0)
|
72
|
-
mime-types (>= 1.16, < 3.0)
|
73
|
-
netrc (~> 0.7)
|
74
|
-
rexml (3.2.6)
|
75
|
-
rspec (3.13.0)
|
76
|
-
rspec-core (~> 3.13.0)
|
77
|
-
rspec-expectations (~> 3.13.0)
|
78
|
-
rspec-mocks (~> 3.13.0)
|
79
|
-
rspec-core (3.13.0)
|
80
|
-
rspec-support (~> 3.13.0)
|
81
|
-
rspec-expectations (3.13.0)
|
82
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
83
|
-
rspec-support (~> 3.13.0)
|
84
|
-
rspec-mocks (3.13.0)
|
85
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
86
|
-
rspec-support (~> 3.13.0)
|
87
|
-
rspec-support (3.13.1)
|
88
|
-
rubocop (1.62.1)
|
89
|
-
json (~> 2.3)
|
90
|
-
language_server-protocol (>= 3.17.0)
|
91
|
-
parallel (~> 1.10)
|
92
|
-
parser (>= 3.3.0.2)
|
93
|
-
rainbow (>= 2.2.2, < 4.0)
|
94
|
-
regexp_parser (>= 1.8, < 3.0)
|
95
|
-
rexml (>= 3.2.5, < 4.0)
|
96
|
-
rubocop-ast (>= 1.31.1, < 2.0)
|
97
|
-
ruby-progressbar (~> 1.7)
|
98
|
-
unicode-display_width (>= 2.4.0, < 3.0)
|
99
|
-
rubocop-ast (1.31.2)
|
100
|
-
parser (>= 3.3.0.4)
|
101
|
-
ruby-progressbar (1.13.0)
|
102
|
-
simplecov (0.20.0)
|
103
|
-
docile (~> 1.1)
|
104
|
-
simplecov-html (~> 0.11)
|
105
|
-
simplecov_json_formatter (~> 0.1)
|
106
|
-
simplecov-html (0.12.3)
|
107
|
-
simplecov-lcov (0.8.0)
|
108
|
-
simplecov_json_formatter (0.1.4)
|
109
|
-
snaky_hash (2.0.1)
|
110
|
-
hashie
|
111
|
-
version_gem (~> 1.1, >= 1.1.1)
|
112
|
-
sync (0.5.0)
|
113
|
-
term-ansicolor (1.7.2)
|
114
|
-
tins (~> 1.0)
|
115
|
-
thor (1.3.1)
|
116
|
-
tins (1.32.1)
|
117
|
-
sync
|
118
|
-
unicode-display_width (2.5.0)
|
119
|
-
uri (0.13.0)
|
120
|
-
version_gem (1.1.4)
|
121
|
-
webmock (3.13.0)
|
122
|
-
addressable (>= 2.3.6)
|
123
|
-
crack (>= 0.3.2)
|
124
|
-
hashdiff (>= 0.4.0, < 2.0.0)
|
125
|
-
|
126
|
-
PLATFORMS
|
127
|
-
ruby
|
128
|
-
x86_64-darwin-23
|
129
|
-
|
130
|
-
DEPENDENCIES
|
131
|
-
addressable (~> 2.3.8)
|
132
|
-
coveralls_reborn (~> 0.19.0)
|
133
|
-
json
|
134
|
-
mime-types (~> 1.25)
|
135
|
-
omniauth-vipps!
|
136
|
-
rack-test
|
137
|
-
rake (~> 13.0)
|
138
|
-
rest-client (~> 1.8.0)
|
139
|
-
rspec (~> 3.2)
|
140
|
-
rubocop (~> 1.21)
|
141
|
-
simplecov-lcov
|
142
|
-
tins (~> 1.13)
|
143
|
-
webmock (~> 3.0)
|
144
|
-
|
145
|
-
BUNDLED WITH
|
146
|
-
2.5.3
|
data/bin/console
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require "bundler/setup"
|
5
|
-
require "omniauth-vipps"
|
6
|
-
|
7
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
-
# with your gem easier. You can also use a different console, if you like.
|
9
|
-
|
10
|
-
require "irb"
|
11
|
-
IRB.start(__FILE__)
|
data/bin/setup
DELETED
Binary file
|