gitlab-omniauth-openid-connect 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/config/rubocop_linter_action.yml +59 -0
- data/.github/stale.yml +17 -0
- data/.github/workflows/rubocop.yml +22 -0
- data/.gitignore +20 -0
- data/.gitlab-ci.yml +27 -0
- data/.rubocop.yml +58 -0
- data/.travis.yml +9 -0
- data/CHANGELOG.md +53 -0
- data/Gemfile +4 -0
- data/Guardfile +16 -0
- data/LICENSE.txt +22 -0
- data/README.md +130 -0
- data/Rakefile +10 -0
- data/gitlab-omniauth-openid-connect.gemspec +35 -0
- data/lib/omniauth/openid_connect.rb +5 -0
- data/lib/omniauth/openid_connect/errors.rb +9 -0
- data/lib/omniauth/openid_connect/version.rb +7 -0
- data/lib/omniauth/strategies/openid_connect.rb +406 -0
- data/lib/omniauth_openid_connect.rb +3 -0
- data/test/fixtures/id_token.txt +1 -0
- data/test/fixtures/jwks.json +8 -0
- data/test/fixtures/test.crt +19 -0
- data/test/lib/omniauth/strategies/openid_connect_test.rb +684 -0
- data/test/strategy_test_case.rb +64 -0
- data/test/test_helper.rb +16 -0
- metadata +258 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ba1a1f85a4f4302aa277a818b0c6f1a19f0aa09bd10815a6cc339cbc8e19b630
|
4
|
+
data.tar.gz: 91ded3eb14016b4ee15823b34e8c2b6960e7bafbcb5812596722c469b101e91f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7f89ac2119d55244bec0c7a5f1b155b082e2e8c8d9f66ff54dbda173e167872847898d53b0d6cf6eb5d670c3d262ebfe1a0632bc25cfaf5ef178b586cae62de8
|
7
|
+
data.tar.gz: e29da0221ea0895ce5951239ffc347669ceff53b8574a9e463ee00392c5aec032d61ea9544b0f4ee47395e440c3c2ddde0ed42ecfe54daa78e4cb204d1c8f2d9
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# Description: The name of the check that will be created.
|
2
|
+
# Valid Options: A reasonably sized string.
|
3
|
+
# Default: 'Rubocop Action'
|
4
|
+
check_name: 'Rubocop Results'
|
5
|
+
|
6
|
+
# Description: Versions required to run your RuboCop checks.
|
7
|
+
# Valid options: RuboCop and any RuboCop extension, by default the latest gem version will be used. You can explicitly state that
|
8
|
+
# (not required) or use a version number, like '1.5.1'.
|
9
|
+
# Default:
|
10
|
+
# versions:
|
11
|
+
# - rubocop: 'latest'
|
12
|
+
versions:
|
13
|
+
- rubocop
|
14
|
+
- rubocop-minitest
|
15
|
+
- rubocop-performance: '1.5.1'
|
16
|
+
|
17
|
+
# Description: Rubocop configuration file path relative to the workspace.
|
18
|
+
# Valid options: A valid file path inside of the workspace.
|
19
|
+
# Default: nil
|
20
|
+
# Note: This does not need to be filled out for Rubocop to still find your config.
|
21
|
+
# Resource: https://rubocop.readthedocs.io/en/stable/configuration/
|
22
|
+
rubocop_config_path: '.rubocop.yml'
|
23
|
+
|
24
|
+
# Run all cops enabled by configuration except this list.
|
25
|
+
# Valid options: list of valid cop(s) and/or departments.
|
26
|
+
# Default: nil
|
27
|
+
# Resource: https://rubocop.readthedocs.io/en/stable/cops/
|
28
|
+
# rubocop_excluded_cops:
|
29
|
+
# - 'Style/FrozenStringLiteralComment'
|
30
|
+
|
31
|
+
# Minimum severity for exit with error code
|
32
|
+
# Valid options: 'refactor', 'convention', 'warning', 'error', or 'fatal'.
|
33
|
+
# Default: 'warning'
|
34
|
+
# Resource: https://rubocop.readthedocs.io/en/stable/configuration/#severity
|
35
|
+
# rubocop_fail_level: 'warning'
|
36
|
+
|
37
|
+
# Whether or not to use --force-exclusion when building the rubocop command. Use this if you are only linting modified
|
38
|
+
# files and typically excluded files have been changed. For example, if you exclude db/schema.rb in your rubocop.yml
|
39
|
+
# but a change gets made, then with the check_scope config set to 'modified' rubocop will lint db/schema.rb. If you set
|
40
|
+
# this to true, rubocop will ignore it.
|
41
|
+
# Valid options: true || false
|
42
|
+
# Default: false
|
43
|
+
|
44
|
+
# Instead of installing gems from rubygems, we can run `bundle install` on your project,
|
45
|
+
# you would need to do this if you are using something like 'rubocop-github' or if you don't
|
46
|
+
# want to list out dependencies with the `versions` key.
|
47
|
+
# Valid options: true || false
|
48
|
+
# Default: false
|
49
|
+
# bundle: false
|
50
|
+
|
51
|
+
# The scope of code that Rubocop should lint. Use this if you only want to lint changed files. If this is not set
|
52
|
+
# or not equal to 'modified', Rubocop is run against the entire codebase. Note that this will not work on the master branch.
|
53
|
+
# Valid options: 'modified'
|
54
|
+
# Default: nil
|
55
|
+
|
56
|
+
# The base branch against which changes will be compared, if check_scope config is set to 'modified'.
|
57
|
+
# This setting is not used if check_scope != 'modified'.
|
58
|
+
# Valid options: 'origin/another_branch'
|
59
|
+
# Default: 'origin/master'
|
data/.github/stale.yml
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Number of days of inactivity before an issue becomes stale
|
2
|
+
daysUntilStale: 60
|
3
|
+
# Number of days of inactivity before a stale issue is closed
|
4
|
+
daysUntilClose: 7
|
5
|
+
# Issues with these labels will never be considered stale
|
6
|
+
exemptLabels:
|
7
|
+
- pinned
|
8
|
+
- security
|
9
|
+
# Label to use when marking an issue as stale
|
10
|
+
staleLabel: wontfix
|
11
|
+
# Comment to post when marking an issue as stale. Set to `false` to disable
|
12
|
+
markComment: >
|
13
|
+
This issue has been automatically marked as stale because it has not had
|
14
|
+
recent activity. It will be closed if no further activity occurs. Thank you
|
15
|
+
for your contributions.
|
16
|
+
# Comment to post when closing a stale issue. Set to `false` to disable
|
17
|
+
closeComment: false
|
@@ -0,0 +1,22 @@
|
|
1
|
+
name: Rubocop check
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
branches:
|
6
|
+
- "*"
|
7
|
+
push:
|
8
|
+
branches:
|
9
|
+
- master
|
10
|
+
jobs:
|
11
|
+
build:
|
12
|
+
name: RuboCop Action
|
13
|
+
runs-on: ubuntu-latest
|
14
|
+
steps:
|
15
|
+
- name: Checkout Action
|
16
|
+
uses: actions/checkout@v1
|
17
|
+
- name: Rubocop Linter Action
|
18
|
+
uses: andrewmcodes/rubocop-linter-action@v3.2.0
|
19
|
+
with:
|
20
|
+
action_config_path: '.github/config/rubocop_linter_action.yml'
|
21
|
+
env:
|
22
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
data/.gitignore
ADDED
data/.gitlab-ci.yml
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
.test-template: &test
|
2
|
+
cache:
|
3
|
+
paths:
|
4
|
+
- vendor/ruby
|
5
|
+
before_script:
|
6
|
+
- gem install bundler --no-document
|
7
|
+
- bundle config set --local path 'vendor/ruby'
|
8
|
+
- bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby
|
9
|
+
- ruby -v # Print out ruby version for debugging
|
10
|
+
script:
|
11
|
+
- bundle exec rake test
|
12
|
+
|
13
|
+
rspec-2.5:
|
14
|
+
image: "ruby:2.5"
|
15
|
+
<<: *test
|
16
|
+
|
17
|
+
rspec-2.6:
|
18
|
+
image: "ruby:2.6"
|
19
|
+
<<: *test
|
20
|
+
|
21
|
+
rspec-2.7:
|
22
|
+
image: "ruby:2.7"
|
23
|
+
<<: *test
|
24
|
+
|
25
|
+
rspec-3.0:
|
26
|
+
image: "ruby:3.0"
|
27
|
+
<<: *test
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
LineLength:
|
2
|
+
Description: 'Limit lines to 130 characters.'
|
3
|
+
Max: 130
|
4
|
+
|
5
|
+
Layout/SpaceInsideStringInterpolation:
|
6
|
+
Enabled: false
|
7
|
+
|
8
|
+
Layout/MultilineOperationIndentation:
|
9
|
+
EnforcedStyle: indented
|
10
|
+
|
11
|
+
StringLiterals:
|
12
|
+
EnforcedStyle: single_quotes
|
13
|
+
|
14
|
+
Style/TrailingCommaInArrayLiteral:
|
15
|
+
EnforcedStyleForMultiline: comma
|
16
|
+
Style/TrailingCommaInHashLiteral:
|
17
|
+
EnforcedStyleForMultiline: comma
|
18
|
+
|
19
|
+
Style/SafeNavigation:
|
20
|
+
Enabled: false
|
21
|
+
|
22
|
+
Style/EmptyMethod:
|
23
|
+
Description: 'Checks the formatting of empty method definitions.'
|
24
|
+
StyleGuide: '#no-single-line-methods'
|
25
|
+
Enabled: false
|
26
|
+
|
27
|
+
HashSyntax:
|
28
|
+
Description: "Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax\n{ :a => 1, :b => 2 }"
|
29
|
+
EnforcedStyle: ruby19
|
30
|
+
Enabled: true
|
31
|
+
|
32
|
+
RedundantBegin:
|
33
|
+
Enabled: true
|
34
|
+
|
35
|
+
Documentation:
|
36
|
+
Enabled: false
|
37
|
+
|
38
|
+
Metrics/AbcSize:
|
39
|
+
Max: 50
|
40
|
+
|
41
|
+
Metrics/CyclomaticComplexity:
|
42
|
+
Max: 50
|
43
|
+
|
44
|
+
Metrics/PerceivedComplexity:
|
45
|
+
Max: 15
|
46
|
+
|
47
|
+
Metrics/BlockLength:
|
48
|
+
Max: 40
|
49
|
+
|
50
|
+
Metrics/MethodLength:
|
51
|
+
Max: 45
|
52
|
+
|
53
|
+
AllCops:
|
54
|
+
Exclude:
|
55
|
+
- bin/**/*
|
56
|
+
- Rakefile
|
57
|
+
- config/**/*
|
58
|
+
- test/**/*
|
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# v0.4.0 (04.23.2021)
|
2
|
+
|
3
|
+
- [Fetch key from JWKS URI if available](https://gitlab.com/gitlab-org/gitlab-omniauth-openid-connect/-/merge_requests/3)
|
4
|
+
- [Fix handling of JWT without key ID](https://gitlab.com/gitlab-org/gitlab-omniauth-openid-connect/-/merge_requests/2)
|
5
|
+
- [Add .gitlab-ci.yml and test with Ruby 3.0](https://gitlab.com/gitlab-org/gitlab-omniauth-openid-connect/-/merge_requests/1)
|
6
|
+
|
7
|
+
# v0.3.5 (07.06.2020)
|
8
|
+
|
9
|
+
- bugfix: Info from decoded id_token is not exposed into `request.env['omniauth.auth']` [#61](https://github.com/m0n9oose/omniauth_openid_connect/pull/61)
|
10
|
+
- bugfix: NoMethodError (`undefined method 'count' for #<OpenIDConnect::ResponseObject::IdToken>`) [#60](https://github.com/m0n9oose/omniauth_openid_connect/pull/60)
|
11
|
+
|
12
|
+
# v0.3.4 (21.05.2020)
|
13
|
+
|
14
|
+
- Try to verify id_token when response_type is code [#44](https://github.com/m0n9oose/omniauth_openid_connect/pull/44)
|
15
|
+
- Provide more information on error [#49](https://github.com/m0n9oose/omniauth_openid_connect/pull/49)
|
16
|
+
- Update configuration documentation [#53](https://github.com/m0n9oose/omniauth_openid_connect/pull/53)
|
17
|
+
- Add documentation about the send_scope_to_token_endpoint config property [#52](https://github.com/m0n9oose/omniauth_openid_connect/pull/52)
|
18
|
+
- refactor: take uid_field from raw_attributes [#54](https://github.com/m0n9oose/omniauth_openid_connect/pull/54)
|
19
|
+
- chore(ci): add 2.7, ruby-head and jruby-head [#55](https://github.com/m0n9oose/omniauth_openid_connect/pull/55)
|
20
|
+
|
21
|
+
# v0.3.3 (09.11.2019)
|
22
|
+
|
23
|
+
- Pass `acr_values` to authorize url [#43](https://github.com/m0n9oose/omniauth_openid_connect/pull/43)
|
24
|
+
- Add raw info for id token [#42](https://github.com/m0n9oose/omniauth_openid_connect/pull/42)
|
25
|
+
- Fixed `id_token` verification when `id_token` is not used [#41](https://github.com/m0n9oose/omniauth_openid_connect/pull/41)
|
26
|
+
- Cast `response_type` to string when checking if it is set in params [#36](https://github.com/m0n9oose/omniauth_openid_connect/pull/36)
|
27
|
+
- Support both symbol and string version of `response_type` option [#35](https://github.com/m0n9oose/omniauth_openid_connect/pull/35)
|
28
|
+
- Fix gemspec homepage [#33](https://github.com/m0n9oose/omniauth_openid_connect/pull/33)
|
29
|
+
- Add support for `response_type` `id_token` [#32](https://github.com/m0n9oose/omniauth_openid_connect/pull/32)
|
30
|
+
|
31
|
+
# v0.3.2 (03.08.2019)
|
32
|
+
|
33
|
+
- Use response_mode in `authorize_uri` if the option is defined [#30](https://github.com/m0n9oose/omniauth_openid_connect/pull/30)
|
34
|
+
- Move verification of `id_token` to before accessing tokens [#28](https://github.com/m0n9oose/omniauth_openid_connect/pull/28)
|
35
|
+
- Update omniauth dependency [#26](https://github.com/m0n9oose/omniauth_openid_connect/pull/26)
|
36
|
+
|
37
|
+
# v0.3.1 (08.06.2019)
|
38
|
+
|
39
|
+
- Set default OmniAuth name to openid_connect [#23](https://github.com/m0n9oose/omniauth_openid_connect/pull/23)
|
40
|
+
|
41
|
+
# v0.3.0 (27.04.2019)
|
42
|
+
|
43
|
+
- RP-Initiated Logout phase [#5](https://github.com/m0n9oose/omniauth_openid_connect/pull/5)
|
44
|
+
- Allows `ui_locales`, `claims_locales` and `login_hint` as request params [#6](https://github.com/m0n9oose/omniauth_openid_connect/pull/6)
|
45
|
+
- Make uid label configurable [#11](https://github.com/m0n9oose/omniauth_openid_connect/pull/11)
|
46
|
+
- Allow rails applications to handle state mismatch [#14](https://github.com/m0n9oose/omniauth_openid_connect/pull/14)
|
47
|
+
- Handle errors when fetching access_token at callback_phase [#17](https://github.com/m0n9oose/omniauth_openid_connect/pull/17)
|
48
|
+
- Allow state method to receive env [#19](https://github.com/m0n9oose/omniauth_openid_connect/pull/19)
|
49
|
+
|
50
|
+
# v0.2.4 (06.01.2019)
|
51
|
+
|
52
|
+
- Prompt and login hint [#4](https://github.com/m0n9oose/omniauth_openid_connect/pull/4)
|
53
|
+
- Bump openid_connect dependency [#9](https://github.com/m0n9oose/omniauth_openid_connect/pull/9)
|
data/Gemfile
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# A sample Guardfile
|
4
|
+
# More info at https://github.com/guard/guard#readme
|
5
|
+
|
6
|
+
guard 'minitest' do
|
7
|
+
# with Minitest::Unit
|
8
|
+
watch(%r{^test/(.*)\/(.*)_test\.rb})
|
9
|
+
watch(%r{^lib/(.*)\.rb}) { |m| "test/lib/#{m[1]}_test.rb" }
|
10
|
+
watch(%r{^test/test_helper\.rb}) { 'test' }
|
11
|
+
end
|
12
|
+
|
13
|
+
guard :bundler do
|
14
|
+
watch('Gemfile')
|
15
|
+
watch(/^.+\.gemspec/)
|
16
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 John Bohn
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
# OmniAuth::OpenIDConnect
|
2
|
+
|
3
|
+
This project was forked from
|
4
|
+
[m0n9oose/omniauth_openid_connect](https://github.com/m0n9oose/omniauth_openid_connect)
|
5
|
+
since a number of important bug fixes have not been merged in the past year.
|
6
|
+
|
7
|
+
Originally was [omniauth-openid-connect](https://github.com/jjbohn/omniauth-openid-connect)
|
8
|
+
|
9
|
+
I've forked this repository and launch as separate gem because maintaining of original was dropped.
|
10
|
+
|
11
|
+
[![Build Status](https://travis-ci.org/m0n9oose/omniauth_openid_connect.png?branch=master)](https://travis-ci.org/m0n9oose/omniauth_openid_connect)
|
12
|
+
|
13
|
+
## Installation
|
14
|
+
|
15
|
+
Add this line to your application's Gemfile:
|
16
|
+
|
17
|
+
gem 'gitlab-omniauth-openid-connect', require: 'omniauth_openid_connect'
|
18
|
+
|
19
|
+
And then execute:
|
20
|
+
|
21
|
+
$ bundle
|
22
|
+
|
23
|
+
Or install it yourself as:
|
24
|
+
|
25
|
+
$ gem install omniauth_openid_connect
|
26
|
+
|
27
|
+
## Supported Ruby Versions
|
28
|
+
|
29
|
+
OmniAuth::OpenIDConnect is tested under 2.4, 2.5, 2.6, 2.7
|
30
|
+
|
31
|
+
## Usage
|
32
|
+
|
33
|
+
Example configuration
|
34
|
+
```ruby
|
35
|
+
config.omniauth :openid_connect, {
|
36
|
+
name: :my_provider,
|
37
|
+
scope: [:openid, :email, :profile, :address],
|
38
|
+
response_type: :code,
|
39
|
+
uid_field: "preferred_username",
|
40
|
+
client_options: {
|
41
|
+
port: 443,
|
42
|
+
scheme: "https",
|
43
|
+
host: "myprovider.com",
|
44
|
+
identifier: ENV["OP_CLIENT_ID"],
|
45
|
+
secret: ENV["OP_SECRET_KEY"],
|
46
|
+
redirect_uri: "http://myapp.com/users/auth/openid_connect/callback",
|
47
|
+
},
|
48
|
+
}
|
49
|
+
```
|
50
|
+
|
51
|
+
### Options Overview
|
52
|
+
|
53
|
+
| Field | Description | Required | Default | Example/Options |
|
54
|
+
|------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------------------------|-----------------------------------------------------|
|
55
|
+
| name | Arbitrary string to identify connection and identify it from other openid_connect providers | no | String: openid_connect | :my_idp |
|
56
|
+
| issuer | Root url for the authorization server | yes | | https://myprovider.com |
|
57
|
+
| discovery | Should OpenID discovery be used. This is recommended if the IDP provides a discovery endpoint. See client config for how to manually enter discovered values. | no | false | one of: true, false |
|
58
|
+
| client_auth_method | Which authentication method to use to authenticate your app with the authorization server | no | Sym: basic | "basic", "jwks" |
|
59
|
+
| scope | Which OpenID scopes to include (:openid is always required) | no | Array<sym> [:openid] | [:openid, :profile, :email] |
|
60
|
+
| response_type | Which OAuth2 response type to use with the authorization request | no | String: code | one of: 'code', 'id_token' |
|
61
|
+
| state | A value to be used for the OAuth2 state parameter on the authorization request. Can be a proc that generates a string. | no | Random 16 character string | Proc.new { SecureRandom.hex(32) } |
|
62
|
+
| response_mode | The response mode per [spec](https://openid.net/specs/oauth-v2-form-post-response-mode-1_0.html) | no | nil | one of: :query, :fragment, :form_post, :web_message |
|
63
|
+
| display | An optional parameter to the authorization request to determine how the authorization and consent page | no | nil | one of: :page, :popup, :touch, :wap |
|
64
|
+
| prompt | An optional parameter to the authrization request to determine what pages the user will be shown | no | nil | one of: :none, :login, :consent, :select_account |
|
65
|
+
| send_scope_to_token_endpoint | Should the scope parameter be sent to the authorization token endpoint? | no | true | one of: true, false |
|
66
|
+
| post_logout_redirect_uri | The logout redirect uri to use per the [session management draft](https://openid.net/specs/openid-connect-session-1_0.html) | no | empty | https://myapp.com/logout/callback |
|
67
|
+
| uid_field | The field of the user info response to be used as a unique id | no | 'sub' | "sub", "preferred_username" |
|
68
|
+
| client_options | A hash of client options detailed in its own section | yes | | |
|
69
|
+
|
70
|
+
### Client Config Options
|
71
|
+
|
72
|
+
These are the configuration options for the client_options hash of the configuration.
|
73
|
+
|
74
|
+
| Field | Description | Default | Replaced by discovery? |
|
75
|
+
|------------------------|-----------------------------------------------------------------|------------|------------------------|
|
76
|
+
| identifier | The OAuth2 client_id | | |
|
77
|
+
| secret | The OAuth2 client secret | | |
|
78
|
+
| redirect_uri | The OAuth2 authorization callback url in your app | | |
|
79
|
+
| scheme | The http scheme to use | https | |
|
80
|
+
| host | The host of the authorization server | nil | |
|
81
|
+
| port | The port for the authorization server | 443 | |
|
82
|
+
| authorization_endpoint | The authorize endpoint on the authorization server | /authorize | yes |
|
83
|
+
| token_endpoint | The token endpoint on the authorization server | /token | yes |
|
84
|
+
| userinfo_endpoint | The user info endpoint on the authorization server | /userinfo | yes |
|
85
|
+
| jwks_uri | The jwks_uri on the authorization server | /jwk | yes |
|
86
|
+
| end_session_endpoint | The url to call to log the user out at the authorization server | nil | yes |
|
87
|
+
|
88
|
+
### Additional Configuration Notes
|
89
|
+
* `name` is arbitrary, I recommend using the name of your provider. The name
|
90
|
+
configuration exists because you could be using multiple OpenID Connect
|
91
|
+
providers in a single app.
|
92
|
+
|
93
|
+
**NOTE**: if you use this gem with Devise you should use `:openid_connect` name,
|
94
|
+
or Devise would route to 'users/auth/:provider' rather than 'users/auth/openid_connect'
|
95
|
+
|
96
|
+
* `response_type` tells the authorization server which grant type the application wants to use,
|
97
|
+
currently, only `:code` (Authorization Code grant) and `:id_token` (Implicit grant) are valid.
|
98
|
+
* If you want to pass `state` paramete by yourself. You can set Proc Object.
|
99
|
+
e.g. `state: Proc.new { SecureRandom.hex(32) }`
|
100
|
+
* `nonce` is optional. If don't want to pass "nonce" parameter to provider, You should specify
|
101
|
+
`false` to `send_nonce` option. (default true)
|
102
|
+
* Support for other client authentication methods. If don't specified
|
103
|
+
`:client_auth_method` option, automatically set `:basic`.
|
104
|
+
* Use "OpenID Connect Discovery", You should specify `true` to `discovery` option. (default false)
|
105
|
+
* In "OpenID Connect Discovery", generally provider should have Webfinger endpoint.
|
106
|
+
If provider does not have Webfinger endpoint, You can specify "Issuer" to option.
|
107
|
+
e.g. `issuer: "https://myprovider.com"`
|
108
|
+
It means to get configuration from "https://myprovider.com/.well-known/openid-configuration".
|
109
|
+
* The uid is by default using the `sub` value from the `user_info` response,
|
110
|
+
which in some applications is not the expected value. To avoid such limitations, the uid label can be
|
111
|
+
configured by providing the omniauth `uid_field` option to a different label (i.e. `preferred_username`)
|
112
|
+
that appears in the `user_info` details.
|
113
|
+
* The `issuer` property should exactly match the provider's issuer link.
|
114
|
+
* The `response_mode` option is optional and specifies how the result of the authorization request is formatted.
|
115
|
+
* Some OpenID Connect providers require the `scope` attribute in requests to the token endpoint, even if
|
116
|
+
this is not in the protocol specifications. In those cases, the `send_scope_to_token_endpoint`
|
117
|
+
property can be used to add the attribute to the token request. Initial value is `true`, which means that the
|
118
|
+
scope attribute is included by default.
|
119
|
+
|
120
|
+
For the full low down on OpenID Connect, please check out
|
121
|
+
[the spec](http://openid.net/specs/openid-connect-core-1_0.html).
|
122
|
+
|
123
|
+
## Contributing
|
124
|
+
|
125
|
+
1. Fork it ( http://github.com/m0n9oose/omniauth-openid-connect/fork )
|
126
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
127
|
+
3. Cover your changes with tests and make sure they're green (`bundle install && bundle exec rake test`)
|
128
|
+
4. Commit your changes (`git commit -am 'Add some feature'`)
|
129
|
+
5. Push to the branch (`git push origin my-new-feature`)
|
130
|
+
6. Create new Pull Request
|