omniauth-onshape-oauth2 0.1.3 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 38709ca9ab2a0ee5cad09b1500440d043a1f8680
4
- data.tar.gz: c06c2f7faa4637e8a313ce4306848a97402b0288
3
+ metadata.gz: 64bedec6a3d460681e1f3fb0a086c8ca1756491c
4
+ data.tar.gz: 4fdfe55d40b2535889534538d3d5ac750effcee9
5
5
  SHA512:
6
- metadata.gz: 1bd7e72068eb810131e379856c6ccd64cbd7e97f4a5432e409d4f6be7378b9a3958884b7cdac4edeb72b1eec2e3063e1deacd1d18d7e7352174d30d56e334af8
7
- data.tar.gz: 86f714f84bbc8fae4e209c13c0fe35234906d6b235f976b22c58b202ab79ad4e6d92c7f111613304156441c769f208f688af58687352f0085ded859f7f868d8d
6
+ metadata.gz: 746fec29b9bdf6024c2b9d82003657107847dfbe896825cdddd938672775d544b3640a61a0a24a50a2e4e94e79ad2cfa48c4e2ca5387fc94a7c133ddb559338e
7
+ data.tar.gz: 6bb908e693487d07e96efbc711d87c81054ab7b964dddfb2e1d35e48b01528b28de48bbcb1c788ead7060cff36d14042a709b35a89c3c0f196adf35e0b8939c2
data/README.md CHANGED
@@ -29,9 +29,21 @@ Rails.application.config.middleware.use OmniAuth::Builder do
29
29
  provider :onshape, ENV['ONSHAPE_KEY'], ENV['ONSHAPE_SECRET']
30
30
  end
31
31
  ```
32
+
32
33
  You can now access the OmniAuth onShape OAuth2 URL: `/auth/onshape`.
33
34
 
34
- You can also utilize the partner dev server, which has a different strategy, using the provider name :onshape_dev and URL /auth/onshape_dev
35
+ For testing, you can access the partner dev server, which has a different strategy, by passing the options directly:
36
+
37
+ ```ruby
38
+ Rails.application.config.middleware.use OmniAuth::Builder do
39
+ provider :onshape, ENV['ONSHAPE_KEY'], ENV['ONSHAPE_SECRET'],
40
+ :setup => lambda{|env|
41
+ env['omniauth.strategy'].options[:client_options].site = 'https://partner.dev.onshape.com/api';
42
+ env['omniauth.strategy'].options[:client_options].authorize_url = 'https://partner.dev.onshape.com/oauth/authorize';
43
+ env['omniauth.strategy'].options[:client_options].token_url = 'https://partner.dev.onshape.com/oauth/token';
44
+ }
45
+ end
46
+ ```
35
47
 
36
48
  ## Granting Member Permissions to Your Application
37
49
 
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module OnShapeOAuth2
3
- VERSION = "0.1.3"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -2,17 +2,17 @@ require 'omniauth-oauth2'
2
2
 
3
3
  module OmniAuth
4
4
  module Strategies
5
- class OnShapeDev < OmniAuth::Strategies::OAuth2
5
+ class OnShape < OmniAuth::Strategies::OAuth2
6
6
  # Give your strategy a name.
7
- option :name, 'onshape_dev'
7
+ option :name, 'onshape'
8
8
 
9
9
  # This is where you pass the options you would pass when
10
10
  # initializing your consumer from the OAuth gem.
11
11
  option :client_options, {
12
- :site => 'https://partner.dev.onshape.com/api',
13
- :authorize_url => 'https://partner.dev.onshape.com/oauth/authorize',
14
- :token_url => 'https://partner.dev.onshape.com/oauth/token'
15
- }
12
+ :site => 'https://cad.onshape.com/api',
13
+ :authorize_url => 'https://oauth.onshape.com/oauth/authorize',
14
+ :token_url => 'https://oauth.onshape.com/oauth/token'
15
+ }
16
16
 
17
17
  # option :scope, 'r_basicprofile r_emailaddress'
18
18
  # option :fields, ['id', 'email-address', 'first-name', 'last-name', 'headline', 'location', 'industry', 'picture-url', 'public-profile-url']
@@ -27,7 +27,11 @@ module OmniAuth
27
27
  info do
28
28
  {
29
29
  :name => raw_info['name'],
30
- :email => raw_info['email']
30
+ :firstName => raw_info['firstName'],
31
+ :lastName => raw_info['lastName'],
32
+ :email => raw_info['email'],
33
+ :image => raw_info['image'],
34
+ :url => raw_info['href'],
31
35
  }
32
36
  end
33
37
 
@@ -43,4 +47,4 @@ module OmniAuth
43
47
  end
44
48
  end
45
49
 
46
- OmniAuth.config.add_camelization 'onshape_dev', 'OnShapeDev'
50
+ OmniAuth.config.add_camelization 'onshape', 'OnShape'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-onshape-oauth2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brentan Alexander