omniauth-signicat_oauth2 1.0.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 +7 -0
- data/.gitignore +8 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +83 -0
- data/README.md +30 -0
- data/Rakefile +4 -0
- data/bin/console +11 -0
- data/bin/setup +8 -0
- data/lib/omniauth/signicat_oauth2/version.rb +7 -0
- data/lib/omniauth/strategies/signicat_oauth2.rb +47 -0
- data/lib/omniauth-signicat_oauth2.rb +9 -0
- data/omniauth-signicat_oauth2.gemspec +32 -0
- metadata +71 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: dde6e7bd479018896349debb3f5897d807333a5ed184a3dc0ee62d365ea69e69
|
|
4
|
+
data.tar.gz: 0c750edc4c45318d5d2db9125a2a208eac67f85150b9488d1f4ffafd079c6371
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 12dd2f92d9d140378f3abb08b60ee46d6b0bf4b1d84c7a0eec03fc9b08685c27dae79ec4c70c6f62800ab53ec9013cc8357a7fca7fb42940cf5fa156ed3fb6d1
|
|
7
|
+
data.tar.gz: 37191c63c1c61dbabe13b0867d5c7e87b3474e13f59e4096d3622444ca5c40693cf4dbed541cf86dc375dc376bf9287d490260dc85964ff4949a71374c2d25bb
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
omniauth-signicat_oauth2 (0.1.0)
|
|
5
|
+
omniauth-oauth2 (~> 1.7)
|
|
6
|
+
|
|
7
|
+
GEM
|
|
8
|
+
remote: https://rubygems.org/
|
|
9
|
+
specs:
|
|
10
|
+
base64 (0.3.0)
|
|
11
|
+
bigdecimal (3.2.2)
|
|
12
|
+
date (3.4.1)
|
|
13
|
+
erb (5.0.1)
|
|
14
|
+
faraday (2.13.2)
|
|
15
|
+
faraday-net_http (>= 2.0, < 3.5)
|
|
16
|
+
json
|
|
17
|
+
logger
|
|
18
|
+
faraday-net_http (3.4.1)
|
|
19
|
+
net-http (>= 0.5.0)
|
|
20
|
+
hashie (5.0.0)
|
|
21
|
+
io-console (0.8.0)
|
|
22
|
+
irb (1.15.2)
|
|
23
|
+
pp (>= 0.6.0)
|
|
24
|
+
rdoc (>= 4.0.0)
|
|
25
|
+
reline (>= 0.4.2)
|
|
26
|
+
json (2.12.2)
|
|
27
|
+
jwt (3.1.2)
|
|
28
|
+
base64
|
|
29
|
+
logger (1.7.0)
|
|
30
|
+
multi_xml (0.7.2)
|
|
31
|
+
bigdecimal (~> 3.1)
|
|
32
|
+
net-http (0.6.0)
|
|
33
|
+
uri
|
|
34
|
+
oauth2 (2.0.12)
|
|
35
|
+
faraday (>= 0.17.3, < 4.0)
|
|
36
|
+
jwt (>= 1.0, < 4.0)
|
|
37
|
+
logger (~> 1.2)
|
|
38
|
+
multi_xml (~> 0.5)
|
|
39
|
+
rack (>= 1.2, < 4)
|
|
40
|
+
snaky_hash (~> 2.0, >= 2.0.3)
|
|
41
|
+
version_gem (>= 1.1.8, < 3)
|
|
42
|
+
omniauth (2.1.3)
|
|
43
|
+
hashie (>= 3.4.6)
|
|
44
|
+
rack (>= 2.2.3)
|
|
45
|
+
rack-protection
|
|
46
|
+
omniauth-oauth2 (1.8.0)
|
|
47
|
+
oauth2 (>= 1.4, < 3)
|
|
48
|
+
omniauth (~> 2.0)
|
|
49
|
+
pp (0.6.2)
|
|
50
|
+
prettyprint
|
|
51
|
+
prettyprint (0.2.0)
|
|
52
|
+
psych (5.2.6)
|
|
53
|
+
date
|
|
54
|
+
stringio
|
|
55
|
+
rack (3.1.16)
|
|
56
|
+
rack-protection (4.1.1)
|
|
57
|
+
base64 (>= 0.1.0)
|
|
58
|
+
logger (>= 1.6.0)
|
|
59
|
+
rack (>= 3.0.0, < 4)
|
|
60
|
+
rake (13.3.0)
|
|
61
|
+
rdoc (6.14.2)
|
|
62
|
+
erb
|
|
63
|
+
psych (>= 4.0.0)
|
|
64
|
+
reline (0.6.1)
|
|
65
|
+
io-console (~> 0.5)
|
|
66
|
+
snaky_hash (2.0.3)
|
|
67
|
+
hashie (>= 0.1.0, < 6)
|
|
68
|
+
version_gem (>= 1.1.8, < 3)
|
|
69
|
+
stringio (3.1.7)
|
|
70
|
+
uri (1.0.3)
|
|
71
|
+
version_gem (1.1.8)
|
|
72
|
+
|
|
73
|
+
PLATFORMS
|
|
74
|
+
ruby
|
|
75
|
+
x86_64-darwin-22
|
|
76
|
+
|
|
77
|
+
DEPENDENCIES
|
|
78
|
+
irb
|
|
79
|
+
omniauth-signicat_oauth2!
|
|
80
|
+
rake (~> 13.0)
|
|
81
|
+
|
|
82
|
+
BUNDLED WITH
|
|
83
|
+
2.6.5
|
data/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# OmniAuth::SignicatOauth2
|
|
2
|
+
|
|
3
|
+
OmniAuth strategy for Signicat using OAuth 2.0.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
Here's an example for adding the middleware to a Rails application using devise in `config/initializers/devise.rb`:
|
|
8
|
+
|
|
9
|
+
```ruby
|
|
10
|
+
config.omniauth :signicat_oauth2,
|
|
11
|
+
ENV['SIGNICAT_OAUTH2_CLIENT_ID'],
|
|
12
|
+
ENV['SIGNICAT_OAUTH2_CLIENT_SECRET'],
|
|
13
|
+
{
|
|
14
|
+
account: ENV['SIGNICAT_OAUTH2_ACCOUNT'],
|
|
15
|
+
scope: 'openid email profile',
|
|
16
|
+
prompt: 'select_account',
|
|
17
|
+
callback_url: ,
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Options
|
|
22
|
+
|
|
23
|
+
- `account`: Your Signicat account name. This is used to construct the authorization and token URLs.
|
|
24
|
+
- `scope`: A space-separated list of permissions to request.
|
|
25
|
+
- `prompt`: Can be `select_account` to force the user to select an account.
|
|
26
|
+
- `callback_url`: The callback endpoint on the site that is requesting authentication
|
|
27
|
+
|
|
28
|
+
## License
|
|
29
|
+
|
|
30
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
require "bundler/setup"
|
|
5
|
+
require "signicat/omniauth"
|
|
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
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
require "omniauth/strategies/oauth2"
|
|
2
|
+
|
|
3
|
+
module OmniAuth
|
|
4
|
+
module Strategies
|
|
5
|
+
class SignicatOauth2 < OmniAuth::Strategies::OAuth2
|
|
6
|
+
option :name, :signicat_oauth2
|
|
7
|
+
option :account
|
|
8
|
+
option :iss
|
|
9
|
+
option :response_type, 'code'
|
|
10
|
+
|
|
11
|
+
def setup_phase
|
|
12
|
+
super
|
|
13
|
+
options.client_options[:site] ||= "https://#{options.account}.signicat.com/auth/open"
|
|
14
|
+
options.client_options[:authorize_url] ||= "https://#{options.account}.signicat.com/auth/open/connect/authorize"
|
|
15
|
+
options.client_options[:token_url] ||= "https://#{options.account}.signicat.com/auth/open/connect/token"
|
|
16
|
+
options.iss ||= options.client_id
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
uid { raw_info["sub"] }
|
|
20
|
+
|
|
21
|
+
info do
|
|
22
|
+
{
|
|
23
|
+
name: raw_info["name"],
|
|
24
|
+
email: raw_info["email"]
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
extra do
|
|
29
|
+
{
|
|
30
|
+
"raw_info" => raw_info
|
|
31
|
+
}
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def callback_url
|
|
35
|
+
options[:callback_url]
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def raw_info
|
|
39
|
+
userinfo_url = "https://#{options.account}.signicat.com/auth/open/connect/userinfo"
|
|
40
|
+
@raw_info ||= access_token.get(userinfo_url).parsed
|
|
41
|
+
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "lib/omniauth/signicat_oauth2/version"
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = "omniauth-signicat_oauth2"
|
|
7
|
+
spec.version = OmniAuth::SignicatOauth2::VERSION
|
|
8
|
+
spec.authors = ["Relatel"]
|
|
9
|
+
spec.email = ["teknik@relatel.dk"]
|
|
10
|
+
|
|
11
|
+
spec.summary = "OmniAuth strategy for Signicat"
|
|
12
|
+
spec.description = "OmniAuth strategy for Signicat using OAuth2."
|
|
13
|
+
spec.homepage = "https://github.com/relatel/omniauth-signicat_oauth2"
|
|
14
|
+
spec.required_ruby_version = ">= 3.1.0"
|
|
15
|
+
|
|
16
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
|
17
|
+
|
|
18
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
|
19
|
+
spec.metadata["source_code_uri"] = "https://github.com/relatel/omniauth-signicat_oauth2"
|
|
20
|
+
spec.metadata["changelog_uri"] = "https://github.com/relatel/omniauth-signicat_oauth2/blob/master/CHANGELOG.md"
|
|
21
|
+
|
|
22
|
+
# Specify which files should be added to the gem when it is released.
|
|
23
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
24
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
25
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
|
|
26
|
+
end
|
|
27
|
+
spec.bindir = "exe"
|
|
28
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
|
29
|
+
spec.require_paths = ["lib"]
|
|
30
|
+
|
|
31
|
+
spec.add_dependency "omniauth-oauth2", "~> 1.7"
|
|
32
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: omniauth-signicat_oauth2
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Relatel
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2025-08-29 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: omniauth-oauth2
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.7'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.7'
|
|
27
|
+
description: OmniAuth strategy for Signicat using OAuth2.
|
|
28
|
+
email:
|
|
29
|
+
- teknik@relatel.dk
|
|
30
|
+
executables: []
|
|
31
|
+
extensions: []
|
|
32
|
+
extra_rdoc_files: []
|
|
33
|
+
files:
|
|
34
|
+
- ".gitignore"
|
|
35
|
+
- Gemfile
|
|
36
|
+
- Gemfile.lock
|
|
37
|
+
- README.md
|
|
38
|
+
- Rakefile
|
|
39
|
+
- bin/console
|
|
40
|
+
- bin/setup
|
|
41
|
+
- lib/omniauth-signicat_oauth2.rb
|
|
42
|
+
- lib/omniauth/signicat_oauth2/version.rb
|
|
43
|
+
- lib/omniauth/strategies/signicat_oauth2.rb
|
|
44
|
+
- omniauth-signicat_oauth2.gemspec
|
|
45
|
+
homepage: https://github.com/relatel/omniauth-signicat_oauth2
|
|
46
|
+
licenses: []
|
|
47
|
+
metadata:
|
|
48
|
+
allowed_push_host: https://rubygems.org
|
|
49
|
+
homepage_uri: https://github.com/relatel/omniauth-signicat_oauth2
|
|
50
|
+
source_code_uri: https://github.com/relatel/omniauth-signicat_oauth2
|
|
51
|
+
changelog_uri: https://github.com/relatel/omniauth-signicat_oauth2/blob/master/CHANGELOG.md
|
|
52
|
+
post_install_message:
|
|
53
|
+
rdoc_options: []
|
|
54
|
+
require_paths:
|
|
55
|
+
- lib
|
|
56
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - ">="
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: 3.1.0
|
|
61
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
62
|
+
requirements:
|
|
63
|
+
- - ">="
|
|
64
|
+
- !ruby/object:Gem::Version
|
|
65
|
+
version: '0'
|
|
66
|
+
requirements: []
|
|
67
|
+
rubygems_version: 3.5.4
|
|
68
|
+
signing_key:
|
|
69
|
+
specification_version: 4
|
|
70
|
+
summary: OmniAuth strategy for Signicat
|
|
71
|
+
test_files: []
|