Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for PKCE in OIDC #3130

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/initializers/omniauth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
scope: config.scopes.map(&:to_sym),
uid_field: config.uid_field,
issuer: config.issuer,
pkce: config.pkce?,
discovery: config.discovery?,
client_options: client_options
end
Expand Down
1 change: 1 addition & 0 deletions doc/config/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ This document contains all the environment variables which are available for thi
| `OIDC_LOCAL_AUTHENTICATION_ENABLED` | Boolean | When enabled, users with passwords will still be able to login locally. If disable, only OpenID Connect will be available. | true |
| `OIDC_NAME` | String | The name of the OIDC provider as shown in the UI | OIDC Provider |
| `OIDC_ISSUER` | String | The OIDC issuer URL | |
| `OIDC_PKCE` | Boolean | Option to enable Proof Key for Code Exchange by OAuth Public Clients | false |
| `OIDC_IDENTIFIER` | String | The client ID for OIDC | |
| `OIDC_SECRET` | String | The client secret for OIDC | |
| `OIDC_SCOPES` | Array of strings | Scopes to request from the OIDC server. | openid,email |
Expand Down
2 changes: 2 additions & 0 deletions doc/config/yaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ oidc:
name: OIDC Provider
# The OIDC issuer URL
issuer:
# Set pkce option to true if OIDC provider has this option
pkce:
# The client ID for OIDC
identifier:
# The client secret for OIDC
Expand Down
5 changes: 5 additions & 0 deletions lib/postal/config_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,11 @@ module Postal
description "The OIDC issuer URL"
end

boolean :pkce do
description "Option to enable Proof Key for Code Exchange by OAuth Public Clients"
default false
end

string :identifier do
description "The client ID for OIDC"
end
Expand Down