omniauth-mollie 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e942dc0a54e65cdac58532b2bc09333d6dfe25a
4
- data.tar.gz: a657353ed32171f780b4c3eb2ad72e4b43861ca4
3
+ metadata.gz: 5d79c4da0c4822bad19b7929154fadd5b3c63b23
4
+ data.tar.gz: 3e820e6d9f5605b2a05fdd663ccab5a84269b630
5
5
  SHA512:
6
- metadata.gz: 2ebec3d249b17053abf0e235cee5219f6c6f111c9b2954ead2c76d625e170603d13a472c8a8da1310092acc0b6bd6b8217e445d7b77d63dd53cd83f7112e2798
7
- data.tar.gz: c89686f3a762a38a5c9594cade542a297d716d201ec18bceba4a524d4a4b1284e599bdc4f9b9dc3670d01cf16cdba529e32141e77110ffe86aadf6f80526cf8e
6
+ metadata.gz: 76181f2bf8f78abeaec154b7382703b3ebace77369eb2810986c49fa67682007b75548366edac4466fe7da83ad35f669ce4bf004cd69c4bc855d70dde9bbb8e2
7
+ data.tar.gz: 7c3c581c7d8e4670ebe1413452855ee78651f05d0716c2876cd5941c6285c5755b998478a8e705aac33be05416d6c98b475f149ff1801e5ac1a1948e814d698b
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
- # Omniauth::Mollie
1
+ # OmniAuth::Mollie
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/omniauth/mollie`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Write usage instructions here
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
- ## Development
65
+ ## Known limitations
28
66
 
29
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
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
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
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/[USERNAME]/omniauth-mollie.
73
+ Bug reports and pull requests are welcome on GitHub at https://github.com/jenskanis/omniauth-mollie.
36
74
 
37
75
 
38
76
  ## License
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Mollie
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
@@ -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://www.mollie.com/en/docs/oauth/overview"
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.2.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://www.mollie.com/en/docs/oauth/overview
59
+ homepage: https://github.com/jenskanis/omniauth-mollie
89
60
  licenses:
90
61
  - MIT
91
62
  metadata: {}
Binary file