Skip to content

Commit

Permalink
complete and fix 85ca240
Browse files Browse the repository at this point in the history
see also: #1092 ;
thanks @brandonk10

Signed-off-by: Hans Zandbelt <[email protected]>
  • Loading branch information
zandbelt committed Aug 11, 2023
1 parent 7798123 commit 3fe626e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
10 changes: 2 additions & 8 deletions auth_openidc.conf
Original file line number Diff line number Diff line change
Expand Up @@ -725,18 +725,12 @@
# Defines a default URL to be used in case of 3rd-party-init-SSO when no explicit target_link_uri
# has been provided. The user is also redirected to this URL in case an invalid authorization
# response was received.
#
# By default, when no OIDCDefaultURL is set, an expired state cookie will lead to an HTML error page
# being sent to the browser explaining what happened. To copy that (legacy) behaviour when OIDCDefaultURL is set,
# so that the browser is no longer redirected to the OIDCDefaultURL in case of state cookie expiry, use:
# SetEnvIfExpr true OIDC_NO_DEFAULT_URL_ON_STATE_TIMEOUT=true
#
# The default is to not redirect the browser to any URL but return an HTTP/HTML error to the user.
#OIDCDefaultURL <default-url>
#OIDCDefaultURL <relative-or-absolute-url>

# Defines a default URL where the user is sent to after logout, which may be overridden explicitly during logout.
# When not defined and no URL was passed explicitly, a default internal page will be shown.
#OIDCDefaultLoggedOutURL <url>
#OIDCDefaultLoggedOutURL <relative-or-absolute-url>

# Define the OpenID Connect scope(s) that is requested from the OP (eg. "admin edit")
# on a per-path basis in addition to the per-provider configured scopes (OIDCScope).
Expand Down
12 changes: 6 additions & 6 deletions src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,12 +795,12 @@ char* oidc_get_current_url(request_rec *r, const apr_byte_t x_forwarded_headers)
/*
* infer a full absolute URL from the (optional) relative one
*/
const char *oidc_get_absolute_url(request_rec *r, oidc_cfg *cfg, const char *url) {
if ((url != NULL)
&& (url[0] == OIDC_CHAR_FORWARD_SLASH)) {
url = apr_pstrcat(r->pool, oidc_get_current_url_base(r, cfg->x_forwarded_headers),
cfg->redirect_uri, NULL);

const char* oidc_get_absolute_url(request_rec *r, oidc_cfg *cfg,
const char *url) {
if ((url != NULL) && (url[0] == OIDC_CHAR_FORWARD_SLASH)) {
url = apr_pstrcat(r->pool,
oidc_get_current_url_base(r, cfg->x_forwarded_headers), url,
NULL);
oidc_debug(r, "determined absolute url: %s", url);
}
return url;
Expand Down

0 comments on commit 3fe626e

Please sign in to comment.