Browse Source

New env variable: CAS_SECURITY_ASSUME_EMAIL_IS_VERIFIED (#16655)

When using a CAS server, the users only have a temporary email
`change@me-foo-cas.com` which can't be changed but by an
administrator.

We need a new environment variable like for SAML to assume the email
from CAS is verified.

* config/initializers/omniauth.rb: define CAS option for assuming
  email are always verified.
* .env.nanobox: add new variable as an example.
closed-social-glitch-2
Daniel 3 years ago
committed by GitHub
parent
commit
2ed1c92c63
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions
  1. +1
    -0
      .env.nanobox
  2. +2
    -0
      config/initializers/omniauth.rb

+ 1
- 0
.env.nanobox View File

@ -228,6 +228,7 @@ SMTP_FROM_ADDRESS=notifications@${APP_NAME}.nanoapp.io
# CAS_LOCATION_KEY='location'
# CAS_IMAGE_KEY='image'
# CAS_PHONE_KEY='phone'
# CAS_SECURITY_ASSUME_EMAIL_IS_VERIFIED=true
# Optional SAML authentication (cf. omniauth-saml)
# SAML_ENABLED=true

+ 2
- 0
config/initializers/omniauth.rb View File

@ -30,6 +30,8 @@ Devise.setup do |config|
cas_options[:location_key] = ENV['CAS_LOCATION_KEY'] || 'location'
cas_options[:image_key] = ENV['CAS_IMAGE_KEY'] || 'image'
cas_options[:phone_key] = ENV['CAS_PHONE_KEY'] || 'phone'
cas_options[:security] = {}
cas_options[:security][:assume_email_is_verified] = ENV['CAS_SECURITY_ASSUME_EMAIL_IS_VERIFIED'] == 'true'
config.omniauth :cas, cas_options
end

Loading…
Cancel
Save