diff --git a/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/JaspiAuthenticatorFactory.java b/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/JaspiAuthenticatorFactory.java index 821ae5e6d76..adc240a939e 100644 --- a/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/JaspiAuthenticatorFactory.java +++ b/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/JaspiAuthenticatorFactory.java @@ -19,6 +19,7 @@ package org.eclipse.jetty.security.jaspi; import java.security.Principal; +import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -137,7 +138,7 @@ public class JaspiAuthenticatorFactory extends DefaultAuthenticatorFactory { if (_serviceSubject!=null) return _serviceSubject; - List subjects = server.getBeans(Subject.class); + List subjects = (List)server.getBeans(Subject.class); if (subjects.size()>0) return (Subject)subjects.get(0); return null; diff --git a/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/modules/BasicAuthModule.java b/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/modules/BasicAuthModule.java index c6ac10b6ddb..cb251cb9472 100644 --- a/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/modules/BasicAuthModule.java +++ b/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/modules/BasicAuthModule.java @@ -31,7 +31,7 @@ import javax.security.auth.message.MessagePolicy; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.eclipse.jetty.http.HttpHeaders; +import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.util.security.Constraint; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; @@ -75,7 +75,7 @@ public class BasicAuthModule extends BaseAuthModule { HttpServletRequest request = (HttpServletRequest) messageInfo.getRequestMessage(); HttpServletResponse response = (HttpServletResponse) messageInfo.getResponseMessage(); - String credentials = request.getHeader(HttpHeaders.AUTHORIZATION); + String credentials = request.getHeader(HttpHeader.AUTHORIZATION.asString()); try { @@ -87,7 +87,7 @@ public class BasicAuthModule extends BaseAuthModule } if (!isMandatory(messageInfo)) { return AuthStatus.SUCCESS; } - response.setHeader(HttpHeaders.WWW_AUTHENTICATE, "basic realm=\"" + realmName + '"'); + response.setHeader(HttpHeader.WWW_AUTHENTICATE.asString(), "basic realm=\"" + realmName + '"'); response.sendError(HttpServletResponse.SC_UNAUTHORIZED); return AuthStatus.SEND_CONTINUE; } diff --git a/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/modules/DigestAuthModule.java b/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/modules/DigestAuthModule.java index 7b829ff8d73..a73ef356ff7 100644 --- a/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/modules/DigestAuthModule.java +++ b/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/modules/DigestAuthModule.java @@ -32,7 +32,7 @@ import javax.security.auth.message.MessagePolicy; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.eclipse.jetty.http.HttpHeaders; +import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.util.security.Constraint; import org.eclipse.jetty.util.security.Credential; import org.eclipse.jetty.util.B64Code; @@ -87,7 +87,7 @@ public class DigestAuthModule extends BaseAuthModule { HttpServletRequest request = (HttpServletRequest) messageInfo.getRequestMessage(); HttpServletResponse response = (HttpServletResponse) messageInfo.getResponseMessage(); - String credentials = request.getHeader(HttpHeaders.AUTHORIZATION); + String credentials = request.getHeader(HttpHeader.AUTHORIZATION.asString()); try { @@ -155,7 +155,7 @@ public class DigestAuthModule extends BaseAuthModule if (!isMandatory(messageInfo)) { return AuthStatus.SUCCESS; } String domain = request.getContextPath(); if (domain == null) domain = "/"; - response.setHeader(HttpHeaders.WWW_AUTHENTICATE, "Digest realm=\"" + realmName + response.setHeader(HttpHeader.WWW_AUTHENTICATE.asString(), "Digest realm=\"" + realmName + "\", domain=\"" + domain + "\", nonce=\"" diff --git a/pom.xml b/pom.xml index 993c5dbea5c..b0db85e9168 100644 --- a/pom.xml +++ b/pom.xml @@ -407,6 +407,7 @@ jetty-distribution jetty-spring jetty-client + jetty-jaspi jetty-osgi examples/embedded examples/async-rest @@ -420,7 +421,6 @@ jetty-runner jetty-rhttp - jetty-jaspi jetty-proxy jetty-monitor jetty-nested @@ -578,9 +578,7 @@ release - +