omniauth-intercom 0.1.9 → 0.1.10
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 +5 -5
- data/.github/workflows/ci.yml +30 -0
- data/CHANGELOG.md +7 -1
- data/README.md +5 -2
- data/lib/omniauth/intercom/version.rb +1 -1
- data/lib/omniauth/strategies/intercom.rb +6 -2
- data/omniauth-intercom.gemspec +2 -1
- metadata +14 -15
- data/.travis.yml +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 16099f1903a57ba8cd032e9eb423ce91f36b9008a504e0bbfac081c2083d49a9
|
4
|
+
data.tar.gz: 7f78c86c40c436fe8275077f57e9bf1d4b90e7afc464cdd0fc1429e76d8a7465
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87d578451f2808ae17cc2dc21c2217e4ebac73b6eb254d7d649cb119bbd0ab4b3ccc979ab4b963d75d82e9594f640b131b0d230c211be0fb0db7f9e4c7508858
|
7
|
+
data.tar.gz: 072ff8e963d495ee18c3ffdde133f0ebe833cee7d45c226c311214303bceed48fff35202c847de758f839c90f10e129f2124d1887236147b0f0a20b61fd645b5
|
@@ -0,0 +1,30 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
|
9
|
+
strategy:
|
10
|
+
fail-fast: false
|
11
|
+
|
12
|
+
matrix:
|
13
|
+
ruby-version:
|
14
|
+
- 2.3
|
15
|
+
- 2.4
|
16
|
+
- 2.5
|
17
|
+
- 2.6
|
18
|
+
- 2.7
|
19
|
+
- "3.0"
|
20
|
+
- 3.1
|
21
|
+
- 3.2
|
22
|
+
- 3.3
|
23
|
+
|
24
|
+
steps:
|
25
|
+
- uses: actions/checkout@v4
|
26
|
+
- uses: ruby/setup-ruby@v1
|
27
|
+
with:
|
28
|
+
ruby-version: ${{ matrix.ruby-version }}
|
29
|
+
bundler-cache: true
|
30
|
+
- run: bundle exec rspec
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -16,6 +16,9 @@ Then `bundle install`.
|
|
16
16
|
|
17
17
|
## Usage
|
18
18
|
|
19
|
+
**Important** For this to work you need to select the `read_single_admin` permissions in your OAuth application to use this middleware.
|
20
|
+
**Important** You will also need to ensure your `redirect_url` is set to `/auth/intercom/callback`
|
21
|
+
|
19
22
|
`OmniAuth::Strategies::Intercom` is simply a Rack middleware. Read the OmniAuth docs for detailed instructions: https://github.com/intridea/omniauth.
|
20
23
|
|
21
24
|
Here's a quick example, adding the middleware to a Rails app in `config/initializers/omniauth.rb`:
|
@@ -28,8 +31,8 @@ end
|
|
28
31
|
To start the authentication process with Intercom you simply need to access `/auth/intercom` route.
|
29
32
|
You can start the authentication process directly with the signup page by accessing `/auth/intercom?signup=1`
|
30
33
|
|
31
|
-
**Important**
|
32
|
-
**Important**
|
34
|
+
**Important** Reminder: As noted earlier you need the `read_single_admin` permissions to use this middleware.
|
35
|
+
**Important** Reminder: As noted earlier your `redirect_url` should be `/auth/intercom/callback`
|
33
36
|
|
34
37
|
By default Intercom strategy rejects users with unverified email addresses. `info` and `raw_info` in `request.env['omniauth.auth']` will not be populated in that case.
|
35
38
|
To disable this check add `verify_email: false` to your config:
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'omniauth-oauth2'
|
2
|
-
require '
|
2
|
+
require 'base64'
|
3
3
|
|
4
4
|
module OmniAuth
|
5
5
|
module Strategies
|
@@ -53,11 +53,15 @@ module OmniAuth
|
|
53
53
|
protected
|
54
54
|
|
55
55
|
def accept_headers
|
56
|
-
access_token.client.connection.headers['Authorization'] =
|
56
|
+
access_token.client.connection.headers['Authorization'] = "Basic #{basic_auth_credentials}"
|
57
57
|
access_token.client.connection.headers['Accept'] = "application/vnd.intercom.3+json"
|
58
58
|
access_token.client.connection.headers['User-Agent'] = "omniauth-intercom/#{::OmniAuth::Intercom::VERSION}"
|
59
59
|
end
|
60
60
|
|
61
|
+
def basic_auth_credentials
|
62
|
+
Base64.encode64("#{access_token.token}:").delete("\n")
|
63
|
+
end
|
64
|
+
|
61
65
|
def prepopulate_signup_fields_form
|
62
66
|
options.client_options[:authorize_url] += '/signup'
|
63
67
|
signup_hash = signup_fields_hash
|
data/omniauth-intercom.gemspec
CHANGED
@@ -17,9 +17,10 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.bindir = "exe"
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
19
|
spec.require_paths = ["lib"]
|
20
|
+
|
20
21
|
spec.add_runtime_dependency 'omniauth-oauth2', '>= 1.2'
|
22
|
+
spec.add_runtime_dependency 'base64'
|
21
23
|
|
22
|
-
spec.add_development_dependency "bundler", "~> 1.12"
|
23
24
|
spec.add_development_dependency "rake", "~> 10.0"
|
24
25
|
spec.add_development_dependency "rspec", "~> 3.0"
|
25
26
|
spec.add_development_dependency "rack", "~> 1.6"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-intercom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Antoine
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|
@@ -25,19 +25,19 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: base64
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
34
|
-
type: :
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,16 +80,16 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '1.6'
|
83
|
-
description:
|
83
|
+
description:
|
84
84
|
email:
|
85
85
|
- kevin.antoine@intercom.io
|
86
86
|
executables: []
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
+
- ".github/workflows/ci.yml"
|
90
91
|
- ".gitignore"
|
91
92
|
- ".rspec"
|
92
|
-
- ".travis.yml"
|
93
93
|
- CHANGELOG.md
|
94
94
|
- Gemfile
|
95
95
|
- LICENSE.txt
|
@@ -107,7 +107,7 @@ homepage: https://github.com/intercom/omniauth-intercom
|
|
107
107
|
licenses:
|
108
108
|
- MIT
|
109
109
|
metadata: {}
|
110
|
-
post_install_message:
|
110
|
+
post_install_message:
|
111
111
|
rdoc_options: []
|
112
112
|
require_paths:
|
113
113
|
- lib
|
@@ -122,9 +122,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
122
|
- !ruby/object:Gem::Version
|
123
123
|
version: '0'
|
124
124
|
requirements: []
|
125
|
-
|
126
|
-
|
127
|
-
signing_key:
|
125
|
+
rubygems_version: 3.5.11
|
126
|
+
signing_key:
|
128
127
|
specification_version: 4
|
129
128
|
summary: Intercom OAuth2 Strategy for OmniAuth
|
130
129
|
test_files: []
|