Skip to content

Conversation

@AMDoellal
Copy link

Signed-off-by: aldo [email protected]

Description

The redirection logic after successful OIDC login has been adjusted to prevent redirection to the callback or login page. This prevents an infinite loop that previously led to a ‘Maximum call stack size exceeded’ error. This improves the stability of the login flow and ensures correct redirection after successful authentication.

Addressed Issue

This change fixes the issue from Issue #5098.

Checklist

@owasp-dt-bot
Copy link

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

@sebdanielsson
Copy link

@nscuro can you take a look at this? Currently preventing SSO with Entra, and a couple of other IDPs I believe.

@sebdanielsson
Copy link

sebdanielsson commented Nov 12, 2025

window.location.href = redirectTo && isUrlSaveForRedirect(redirectTo) ? redirectTo : "../";
const redirectTo = user.state;
// Verhindere Redirect auf Callback- oder Login-Seite
const forbiddenRedirects = [window.location.pathname, '/login', 'oidc-callback.html'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preventing a redirect to /login would break OIDC authentication entirely, since that is where the actual authentication with DT happens:

// oidcUser will only be set when coming from oidc-callback.html
if (oidcUser === null) {
return;
}
// Exchange OAuth2 Access Token for a JWT issued by Dependency-Track
const url = this.$api.BASE_URL + '/' + this.$api.URL_USER_OIDC_LOGIN;
const requestBody = {
accessToken: oidcUser.access_token,
idToken: oidcUser.id_token,
};
const config = {
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
};

Was this fix tested?

@nscuro
Copy link
Member

nscuro commented Nov 14, 2025

Related: #1380

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants