This repository has been archived by the owner on May 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the CAS server URL configurable (ugly way but CAS Omniauth strat…
…egy doesn't seem to support :setup option for :cas_server ; maybe I'll try to send a pull request later)
- Loading branch information
Showing
5 changed files
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
en: | ||
label_login_with_cas: Login with CAS | ||
label_login_page_text: Login page text | ||
label_cas_server: CAS Server URL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
fr: | ||
label_login_with_cas: S'authentifier avec CAS | ||
label_login_page_text: Texte de la page de login | ||
label_cas_server: Adresse serveur CAS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
author_url 'mailto:[email protected]' | ||
url 'http://github.com/jbbarth/redmine_omniauth_cas' | ||
version '0.0.1' | ||
settings :default => { 'label_login_with_cas' => '' }, | ||
settings :default => { 'label_login_with_cas' => '', 'cas_server' => 'http://localhost:9292/' }, | ||
:partial => 'settings/omniauth_cas_settings' | ||
end | ||
|
||
|
@@ -44,4 +44,10 @@ | |
|
||
# Sample CAS provider | ||
require 'omniauth/enterprise' | ||
config.middleware.use OmniAuth::Strategies::CAS, :cas_server => 'http://localhost:9292' | ||
setup_app = Proc.new do |env| | ||
cas_server = Setting["plugin_redmine_omniauth_cas"]["cas_server"] | ||
cas_server = 'http://localhost:9292/' if cas_server.blank? | ||
config = OmniAuth::Strategies::CAS::Configuration.new(:cas_server => cas_server) | ||
env['omniauth.strategy'].instance_variable_set(:@configuration, config) | ||
end | ||
config.middleware.use OmniAuth::Strategies::CAS, :cas_server => 'http://localhost:9292/', :setup => setup_app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters