mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 08:25:44 +01:00
do not call the authentication mechanism if the user is already authenticated
This commit is contained in:
@@ -120,7 +120,11 @@ public class BasicAuthenticationFilter extends HttpFilter
|
|||||||
User user = null;
|
User user = null;
|
||||||
String authentication = request.getHeader(HEADER_AUTHORIZATION);
|
String authentication = request.getHeader(HEADER_AUTHORIZATION);
|
||||||
|
|
||||||
if (Util.isNotEmpty(authentication))
|
if (securityContext.isAuthenticated())
|
||||||
|
{
|
||||||
|
user = securityContext.getUser();
|
||||||
|
}
|
||||||
|
else if (Util.isNotEmpty(authentication))
|
||||||
{
|
{
|
||||||
if (!authentication.toUpperCase().startsWith(AUTHORIZATION_BASIC_PREFIX))
|
if (!authentication.toUpperCase().startsWith(AUTHORIZATION_BASIC_PREFIX))
|
||||||
{
|
{
|
||||||
@@ -129,10 +133,6 @@ public class BasicAuthenticationFilter extends HttpFilter
|
|||||||
|
|
||||||
user = authenticate(request, response, securityContext, authentication);
|
user = authenticate(request, response, securityContext, authentication);
|
||||||
}
|
}
|
||||||
else if (securityContext.isAuthenticated())
|
|
||||||
{
|
|
||||||
user = securityContext.getUser();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (user == null)
|
if (user == null)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user