summaryrefslogtreecommitdiffstats
path: root/auth_mellon_handler.c
diff options
context:
space:
mode:
authorolavmrk <olavmrk@a716ebb1-153a-0410-b759-cfb97c6a1b53>2014-04-25 09:11:46 +0000
committerolavmrk <olavmrk@a716ebb1-153a-0410-b759-cfb97c6a1b53>2014-04-25 09:11:46 +0000
commitc7a0d4d8f5ea2c8365325070246c704b93a25469 (patch)
treeee869e16f266f45b9933ca4bea6b04373733b742 /auth_mellon_handler.c
parentd1a2b63b74d87c6b16b955f5799ded6fe2b73877 (diff)
downloadmod_auth_mellon-c7a0d4d8f5ea2c8365325070246c704b93a25469.tar.gz
mod_auth_mellon-c7a0d4d8f5ea2c8365325070246c704b93a25469.tar.xz
mod_auth_mellon-c7a0d4d8f5ea2c8365325070246c704b93a25469.zip
Add a helper to redirect on unauthorized error
In case we are going to return a HTTP_UNAUTHORIZED error we can also redirect the client to an admin chosen page to let the application handle the error on its own. Signed-off-by: Simo Sorce <simo@redhat.com> git-svn-id: https://modmellon.googlecode.com/svn/trunk@227 a716ebb1-153a-0410-b759-cfb97c6a1b53
Diffstat (limited to 'auth_mellon_handler.c')
-rw-r--r--auth_mellon_handler.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/auth_mellon_handler.c b/auth_mellon_handler.c
index e5c82a6..1de217a 100644
--- a/auth_mellon_handler.c
+++ b/auth_mellon_handler.c
@@ -1974,6 +1974,7 @@ static int am_handle_post_reply(request_rec *r)
LassoServer *server;
LassoLogin *login;
char *relay_state;
+ am_dir_cfg_rec *dir_cfg = am_get_dir_cfg(r);
int i, err;
/* Make sure that this is a POST request. */
@@ -2048,6 +2049,13 @@ static int am_handle_post_reply(request_rec *r)
break;
}
}
+ if (err == HTTP_UNAUTHORIZED) {
+ if (dir_cfg->no_success_error_page != NULL) {
+ apr_table_setn(r->headers_out, "Location",
+ dir_cfg->no_success_error_page);
+ return HTTP_SEE_OTHER;
+ }
+ }
return err;
}