Skip to content

Commit 0b9c6df

Browse files
committed
Enable Doorkeeper token/application secret hashing
- Enable `hash_application_secrets` and `hash_token_secrets` in Doorkeeper initializer for improved security. - This stores application secrets and access tokens as hashes in the database, reducing risk if the database is compromised. - Note: `hash_token_secrets` is incompatible with `reuse_access_token`, so token reuse is now disabled/removed (see warning in Doorkeeper docs). - For more details, see: https://doorkeeper.gitbook.io/guides/security/token-and-application-secrets
1 parent 6e7c21c commit 0b9c6df

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

config/initializers/doorkeeper.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@
3636

3737
# set the token endpoint configurations
3838
access_token_expires_in 2.hours
39-
reuse_access_token
4039

4140
# enable refresh tokens of duration 90 days
4241
use_refresh_token expiry: 90.days
4342

4443
# enable ssl requirement for redirect url
4544
# - Allow HTTP in test and development environments
4645
force_ssl_in_redirect_uri !(Rails.env.test? || Rails.env.development?)
46+
47+
hash_application_secrets
48+
hash_token_secrets
4749
end

0 commit comments

Comments
 (0)