diff options
author | olavmrk <olavmrk@a716ebb1-153a-0410-b759-cfb97c6a1b53> | 2008-11-11 20:07:44 +0000 |
---|---|---|
committer | olavmrk <olavmrk@a716ebb1-153a-0410-b759-cfb97c6a1b53> | 2008-11-11 20:07:44 +0000 |
commit | 421b8190becaba693ff76dfa6f61978576e27151 (patch) | |
tree | 733e64bd91d21063c36ec64ded6d350ba4f1bc6b /auth_mellon_config.c | |
parent | e8069a282501ffda569d1f84c669d285400b12b1 (diff) | |
download | mod_auth_mellon-421b8190becaba693ff76dfa6f61978576e27151.tar.gz mod_auth_mellon-421b8190becaba693ff76dfa6f61978576e27151.tar.xz mod_auth_mellon-421b8190becaba693ff76dfa6f61978576e27151.zip |
Add MellonDefaultLoginPath option.
This option is used to decide which page the user should be
redirected to if IdP-initiated SSO is used.
Thanks to Emmanuel Dreyfus for this patch.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@36 a716ebb1-153a-0410-b759-cfb97c6a1b53
Diffstat (limited to 'auth_mellon_config.c')
-rw-r--r-- | auth_mellon_config.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/auth_mellon_config.c b/auth_mellon_config.c index 878c140..f22b447 100644 --- a/auth_mellon_config.c +++ b/auth_mellon_config.c @@ -39,6 +39,11 @@ static const char *default_user_attribute = "NAME_ID"; */ static const char *default_cookie_name = "cookie"; +/* This is the default IdP initiated login location + * the MellonDefaultLoginPath configuration directive if you change this. + */ +static const char *default_login_path = "/"; + /* This function handles configuration directives which set a file * slot in the module configuration. If lasso is recent enough, it @@ -434,6 +439,14 @@ const command_rec auth_mellon_commands[] = { "Full path to pem file with CA chain for the IdP." ), AP_INIT_TAKE1( + "MellonDefaultLoginPath", + ap_set_string_slot, + (void *)APR_OFFSETOF(am_dir_cfg_rec, login_path), + OR_AUTHCFG, + "The location where to redirect after IdP initiated login." + " Default value is \"/\"." + ), + AP_INIT_TAKE1( "MellonEndpointPath", am_set_endpoint_path, NULL, @@ -483,6 +496,7 @@ void *auth_mellon_dir_config(apr_pool_t *p, char *d) dir->idp_metadata_file = NULL; dir->idp_public_key_file = NULL; dir->idp_ca_file = NULL; + dir->login_path = default_login_path; apr_thread_mutex_create(&dir->server_mutex, APR_THREAD_MUTEX_DEFAULT, p); @@ -569,10 +583,6 @@ void *auth_mellon_dir_merge(apr_pool_t *p, void *base, void *add) add_cfg->sp_cert_file : base_cfg->sp_cert_file); - new_cfg->sp_cert_file = (add_cfg->sp_cert_file ? - add_cfg->sp_cert_file : - base_cfg->sp_cert_file); - new_cfg->idp_metadata_file = (add_cfg->idp_metadata_file ? add_cfg->idp_metadata_file : base_cfg->idp_metadata_file); @@ -585,10 +595,9 @@ void *auth_mellon_dir_merge(apr_pool_t *p, void *base, void *add) add_cfg->idp_ca_file : base_cfg->idp_ca_file); - - new_cfg->idp_ca_file = (add_cfg->idp_ca_file ? - add_cfg->idp_ca_file : - base_cfg->idp_ca_file); + new_cfg->login_path = (add_cfg->login_path != default_login_path ? + add_cfg->login_path : + base_cfg->login_path); apr_thread_mutex_create(&new_cfg->server_mutex, APR_THREAD_MUTEX_DEFAULT, p); |