Compare commits

...

2 Commits

Author SHA1 Message Date
26a9ad0e2e feat(authn-oidc): match login callback/logout urls with query string by default
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
2024-05-24 15:28:21 +02:00
3e5dd446cb feat(authn-oidc): use relative redirection to prevent internal/public host mixing 2024-05-24 15:27:43 +02:00
2 changed files with 4 additions and 3 deletions

View File

@ -2,6 +2,7 @@ package oidc
import (
"bytes"
"fmt"
"net/http"
"net/url"
"strings"
@ -74,7 +75,7 @@ func (c *Client) login(w http.ResponseWriter, r *http.Request, sess *sessions.Se
sess.Values[sessionKeyLoginState] = state
sess.Values[sessionKeyLoginNonce] = nonce
sess.Values[sessionKeyPostLoginRedirectURL] = originalURL.String()
sess.Values[sessionKeyPostLoginRedirectURL] = fmt.Sprintf("%s?%s", originalURL.Path, originalURL.Query().Encode())
if err := sess.Save(r, w); err != nil {
logger.Error(ctx, "could not save session", logger.E(errors.WithStack(err)))

View File

@ -49,9 +49,9 @@ func fromStoreOptions(storeOptions store.LayerOptions, baseURL string) (*LayerOp
LayerOptions: authn.DefaultLayerOptions(),
OIDC: OIDCOptions{
LoginCallbackURL: baseURL + loginCallbackPath,
MatchLoginCallbackURL: "*" + loginCallbackPath,
MatchLoginCallbackURL: "*" + loginCallbackPath + "*",
LogoutURL: baseURL + logoutPath,
MatchLogoutURL: "*" + logoutPath,
MatchLogoutURL: "*" + logoutPath + "*",
Scopes: []string{"openid"},
},
Cookie: CookieOptions{