Skip to content

Commit 3797ebc

Browse files
authored
Merge pull request #16 from modalsource/D3an1el-postal-pkce
Replica: Add support for PKCE in OIDC
2 parents d811a97 + 7e13573 commit 3797ebc

4 files changed

Lines changed: 9 additions & 0 deletions

File tree

config/initializers/omniauth.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
scope: config.scopes.map(&:to_sym),
1919
uid_field: config.uid_field,
2020
issuer: config.issuer,
21+
pkce: config.pkce?,
2122
discovery: config.discovery?,
2223
client_options: client_options
2324
end

doc/config/environment-variables.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ This document contains all the environment variables which are available for thi
103103
| `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 |
104104
| `OIDC_NAME` | String | The name of the OIDC provider as shown in the UI | OIDC Provider |
105105
| `OIDC_ISSUER` | String | The OIDC issuer URL | |
106+
| `OIDC_PKCE` | Boolean | Option to enable Proof Key for Code Exchange by OAuth Public Clients | false |
106107
| `OIDC_IDENTIFIER` | String | The client ID for OIDC | |
107108
| `OIDC_SECRET` | String | The client secret for OIDC | |
108109
| `OIDC_SCOPES` | Array of strings | Scopes to request from the OIDC server. | ["openid", "email"] |

doc/config/yaml.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ oidc:
235235
name: OIDC Provider
236236
# The OIDC issuer URL
237237
issuer:
238+
# Set pkce option to true if OIDC provider has this option
239+
pkce:
238240
# The client ID for OIDC
239241
identifier:
240242
# The client secret for OIDC

lib/postal/config_schema.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,11 @@ module Postal
580580
description "The OIDC issuer URL"
581581
end
582582

583+
boolean :pkce do
584+
description "Option to enable Proof Key for Code Exchange by OAuth Public Clients"
585+
default false
586+
end
587+
583588
string :identifier do
584589
description "The client ID for OIDC"
585590
end

0 commit comments

Comments
 (0)