omniauth-mollie 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +47 -9
- data/lib/omniauth/mollie/version.rb +1 -1
- data/omniauth-mollie.gemspec +2 -4
- metadata +2 -31
- data/omniauth-mollie-0.1.0.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d79c4da0c4822bad19b7929154fadd5b3c63b23
|
4
|
+
data.tar.gz: 3e820e6d9f5605b2a05fdd663ccab5a84269b630
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76181f2bf8f78abeaec154b7382703b3ebace77369eb2810986c49fa67682007b75548366edac4466fe7da83ad35f669ce4bf004cd69c4bc855d70dde9bbb8e2
|
7
|
+
data.tar.gz: 7c3c581c7d8e4670ebe1413452855ee78651f05d0716c2876cd5941c6285c5755b998478a8e705aac33be05416d6c98b475f149ff1801e5ac1a1948e814d698b
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# OmniAuth::Mollie
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
This is a OmniAuth 1.0 strategy for [Mollie Connect](https://www.mollie.com/en/docs/oauth/overview).
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,17 +20,57 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
### 1. Add the Rack Middleware and configure Mollie Credentials
|
24
|
+
|
25
|
+
Add the Mollie provider to your OmniAuth initializer or create one in `config/initializers/omniauth.rb`.
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
29
|
+
provider :mollie, ENV['MOLLIE_CLIENT_ID'], ENV['MOLLIE_CLIENT_SECRET'], { provider_ignores_state: true }
|
30
|
+
end
|
31
|
+
```
|
32
|
+
|
33
|
+
Important is the `{ provider_ignores_state: true }`, which is necessary in order to make it work. Replace `ENV['MOLLIE_CLIENT_ID']` and `ENV['MOLLIE_SECRET']` credentials with yours. To aquire these credentials, you'll have to create a [Mollie Application](https://www.mollie.com/dashboard/settings/applications).
|
34
|
+
|
35
|
+
|
36
|
+
Use the following redirect URL: `https://[YOUR DOMAIN]/auth/mollie/callback`
|
37
|
+
|
38
|
+
### 2. Connect with Mollie
|
39
|
+
|
40
|
+
After you set up the Rack Middeware and configured Mollie Credentials, you're ready to let users connect with Mollie. To do, let users to go `/auth/mollie`, which will redirect you to Mollie and connect.
|
41
|
+
|
42
|
+
When you are connected, you'll receive an Auth Hash back from calling `request.env['omniauth.auth']`. This is an example Auth Hash:
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
{
|
46
|
+
"provider" => "mollie",
|
47
|
+
"uid" => "<MOLLIE_ORGANIZATION_ID>",
|
48
|
+
"credentials" => {
|
49
|
+
"token" => "<MOLLIE_ACCESS_TOKEN>",
|
50
|
+
"refresh_token" => "<MOLLIE_REFRESH_TOKEN>",
|
51
|
+
"expires" => 1489583888,
|
52
|
+
},
|
53
|
+
"extra"=> {
|
54
|
+
"name" =>"<MOLLIE_ORGANIZATION_NAME>",
|
55
|
+
"email" => "<MOLLIE_ORGANIZATION_EMAIL>",
|
56
|
+
"address" => "<MOLLIE_ORGANIZATION_ADDRESS>",
|
57
|
+
"postalCode" => "<MOLLIE_ORGANIZATION_POSTAL_CODE>",
|
58
|
+
"city" => "<MOLLIE_ORGANIZATION_CITY>",
|
59
|
+
"country" => "<MOLLIE_ORGANIZATION_COUNTRY>",
|
60
|
+
"countryCode" => "<MOLLIE_ORGANIZATION_COUNTRY_CODE>",
|
61
|
+
},
|
62
|
+
}
|
63
|
+
```
|
26
64
|
|
27
|
-
##
|
65
|
+
## Known limitations
|
28
66
|
|
29
|
-
|
67
|
+
1. This only allows you to have the following [Mollie Permissions](https://www.mollie.com/nl/docs/oauth/permissions): `payments.read, customers.read, subscriptions.read, organizations.read`. Please create a pull request if you'd like the gem to have more permissions.
|
30
68
|
|
31
|
-
|
69
|
+
2. Mollie's access tokens expire in **1 hour**, and their refresh tokens expire in **2 weeks**. I contacted Mollie to extend this period or completely remove expirations from access tokens, but have yet to do this. Please [contact Mollie](https://help.mollie.com/hc/en/requests/new) to convince them to do the latter.
|
32
70
|
|
33
71
|
## Contributing
|
34
72
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
73
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/jenskanis/omniauth-mollie.
|
36
74
|
|
37
75
|
|
38
76
|
## License
|
data/omniauth-mollie.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["me@jenskanis.nl"]
|
11
11
|
|
12
12
|
spec.summary = %q{Mollie Connect OAuth2 Strategy for OmniAuth 1.0.}
|
13
|
-
spec.homepage = "https://
|
13
|
+
spec.homepage = "https://github.com/jenskanis/omniauth-mollie"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
@@ -19,9 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.bindir = "exe"
|
20
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
21
|
spec.require_paths = ["lib"]
|
22
|
-
|
23
|
-
spec.add_development_dependency "bundler", "~> 1.14"
|
24
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
22
|
+
|
25
23
|
spec.add_dependency 'omniauth', '~> 1.3'
|
26
24
|
spec.add_dependency 'omniauth-oauth2', '~> 1.4'
|
27
25
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-mollie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Kanis
|
@@ -10,34 +10,6 @@ bindir: exe
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2017-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.14'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.14'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '10.0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '10.0'
|
41
13
|
- !ruby/object:Gem::Dependency
|
42
14
|
name: omniauth
|
43
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -83,9 +55,8 @@ files:
|
|
83
55
|
- lib/omniauth/mollie.rb
|
84
56
|
- lib/omniauth/mollie/version.rb
|
85
57
|
- lib/omniauth/strategies/mollie.rb
|
86
|
-
- omniauth-mollie-0.1.0.gem
|
87
58
|
- omniauth-mollie.gemspec
|
88
|
-
homepage: https://
|
59
|
+
homepage: https://github.com/jenskanis/omniauth-mollie
|
89
60
|
licenses:
|
90
61
|
- MIT
|
91
62
|
metadata: {}
|
data/omniauth-mollie-0.1.0.gem
DELETED
Binary file
|