Commit 96aea88a authored by michael.simon's avatar michael.simon
Browse files

replace all servlet.getLocalName by servlet.getServerName

parent 2326eca6
......@@ -104,10 +104,10 @@ public class OidcOpLoginImpl implements OidcOpLogin {
String state, String nonce, String clientId,
HttpServletRequest request, HttpServletResponse response) throws IOException, OidcAuthenticationException {
OidcOpConfigurationEntity opConfig = opDao.findByRealmAndHost(realm, request.getLocalName());
OidcOpConfigurationEntity opConfig = opDao.findByRealmAndHost(realm, request.getServerName());
if (opConfig == null) {
throw new OidcAuthenticationException("unknown realm/host combination: " + realm + " / " + request.getLocalName());
throw new OidcAuthenticationException("unknown realm/host combination: " + realm + " / " + request.getServerName());
}
IdentityEntity identity = null;
......@@ -153,10 +153,10 @@ public class OidcOpLoginImpl implements OidcOpLogin {
public String registerAuthRequestReturn(String realm, HttpServletRequest request, HttpServletResponse response)
throws IOException, OidcAuthenticationException {
OidcOpConfigurationEntity opConfig = opDao.findByRealmAndHost(realm, request.getLocalName());
OidcOpConfigurationEntity opConfig = opDao.findByRealmAndHost(realm, request.getServerName());
if (opConfig == null) {
throw new OidcAuthenticationException("unknown realm/host combination: " + realm + " / " + request.getLocalName());
throw new OidcAuthenticationException("unknown realm/host combination: " + realm + " / " + request.getServerName());
}
IdentityEntity identity = null;
......@@ -449,10 +449,10 @@ public class OidcOpLoginImpl implements OidcOpLogin {
@Override
public JSONObject serveUserJwt(String realm, HttpServletRequest request, HttpServletResponse response) throws OidcAuthenticationException {
OidcOpConfigurationEntity opConfig = opDao.findByRealmAndHost(realm, request.getLocalName());
OidcOpConfigurationEntity opConfig = opDao.findByRealmAndHost(realm, request.getServerName());
if (opConfig == null) {
throw new OidcAuthenticationException("unknown realm/host combination: " + realm + " / " + request.getLocalName());
throw new OidcAuthenticationException("unknown realm/host combination: " + realm + " / " + request.getServerName());
}
if (session.isLoggedIn()) {
......
......@@ -48,7 +48,7 @@ public class OidcCertsController {
try {
logger.debug("certs called for {}", realm);
OidcOpConfigurationEntity opConfig = opService.findByRealmAndHost(realm, request.getLocalName());
OidcOpConfigurationEntity opConfig = opService.findByRealmAndHost(realm, request.getServerName());
if (opConfig == null) {
throw new OidcAuthenticationException("No such realm");
......
......@@ -47,7 +47,7 @@ public class OidcWellknownController {
public JSONObject wellknown(@PathParam("realm") String realm, @Context HttpServletRequest request, @Context HttpServletResponse response)
throws ServletException {
OidcOpConfigurationEntity opConfig = opService.findByRealmAndHost(realm, request.getLocalName());
OidcOpConfigurationEntity opConfig = opService.findByRealmAndHost(realm, request.getServerName());
if (opConfig == null) {
throw new ServletException("No such realm");
......
......@@ -60,7 +60,7 @@ public class AttributeQueryController {
public Map<String, String> attributeQuery(@PathParam("eppn") String eppn,
@PathParam("service") String serviceShortName, @Context HttpServletRequest request)
throws IOException, ServletException, RestInterfaceException {
return userUpdateService.updateUser(eppn, serviceShortName, request.getLocalName(), "rest-/attrq/eppn/" + serviceShortName + "/" + eppn);
return userUpdateService.updateUser(eppn, serviceShortName, request.getServerName(), "rest-/attrq/eppn/" + serviceShortName + "/" + eppn);
}
@GET
......@@ -69,7 +69,7 @@ public class AttributeQueryController {
public Map<String, String> attributeQueryUidNumber(@PathParam("uidNumber") Long uidNumber,
@PathParam("service") String serviceShortName, @Context HttpServletRequest request)
throws IOException, ServletException, RestInterfaceException {
return userUpdateService.updateUser(uidNumber, serviceShortName, request.getLocalName(), "rest-/attrq/uid-number/" + serviceShortName + "/" + uidNumber);
return userUpdateService.updateUser(uidNumber, serviceShortName, request.getServerName(), "rest-/attrq/uid-number/" + serviceShortName + "/" + uidNumber);
}
@GET
......@@ -77,7 +77,7 @@ public class AttributeQueryController {
@Produces(MediaType.APPLICATION_JSON)
public Map<String, String> attributeQuery(@PathParam("regid") Long regId, @Context HttpServletRequest request)
throws IOException, ServletException, RestInterfaceException {
return userUpdateService.updateUser(regId, request.getLocalName(), "rest-/attrq/regid/" + regId);
return userUpdateService.updateUser(regId, request.getServerName(), "rest-/attrq/regid/" + regId);
}
@GET
......@@ -89,7 +89,7 @@ public class AttributeQueryController {
AttributeQueryResponse response = new AttributeQueryResponse();
try {
userUpdateService.updateUser(eppn, serviceShortName, request.getLocalName(), "rest-/attrq/eppn-xml/" + serviceShortName + "/" + eppn);
userUpdateService.updateUser(eppn, serviceShortName, request.getServerName(), "rest-/attrq/eppn-xml/" + serviceShortName + "/" + eppn);
}
catch (NoUserFoundException e) {
generateFailXml(response, 400, "ecp login failed", "user-not-found");
......@@ -139,7 +139,7 @@ public class AttributeQueryController {
AttributeQueryResponse response = new AttributeQueryResponse();
try {
userUpdateService.updateUser(regId, request.getLocalName(), "rest-/attrq/regid-xml/" + regId);
userUpdateService.updateUser(regId, request.getServerName(), "rest-/attrq/regid-xml/" + regId);
}
catch (NoUserFoundException e) {
generateFailXml(response, 400, "ecp login failed", "user-not-found");
......
......@@ -72,7 +72,7 @@ public class DirectAuthController {
String eppn = (String) request.getAttribute(SecurityFilter.DIRECT_USER_ID);
String password = (String) request.getAttribute(SecurityFilter.DIRECT_USER_PW);
return userLoginService.ecpLogin(eppn, serviceShortName, password, request.getLocalName());
return userLoginService.ecpLogin(eppn, serviceShortName, password, request.getServerName());
}
@Path("/eppn-xml/{service}")
......@@ -89,7 +89,7 @@ public class DirectAuthController {
String eppn = (String) request.getAttribute(SecurityFilter.DIRECT_USER_ID);
String password = (String) request.getAttribute(SecurityFilter.DIRECT_USER_PW);
userLoginService.ecpLogin(eppn, serviceShortName, password, request.getLocalName());
userLoginService.ecpLogin(eppn, serviceShortName, password, request.getServerName());
}
catch (NoUserFoundException e) {
generateFailXml(response, 400, "ecp login failed", "user-not-found");
......
......@@ -70,7 +70,7 @@ public class EcpController {
@FormParam("password") String password, @Context HttpServletRequest request)
throws IOException, ServletException, RestInterfaceException {
return userLoginService.ecpLogin(eppn, serviceShortName, password, request.getLocalName());
return userLoginService.ecpLogin(eppn, serviceShortName, password, request.getServerName());
}
@Path("/eppn-xml/{service}/{eppn}")
......@@ -85,7 +85,7 @@ public class EcpController {
ECPResponse response = new ECPResponse();
try {
userLoginService.ecpLogin(eppn, serviceShortName, password, request.getLocalName());
userLoginService.ecpLogin(eppn, serviceShortName, password, request.getServerName());
}
catch (NoUserFoundException e) {
generateFailXml(response, 400, "ecp login failed", "user-not-found");
......@@ -155,7 +155,7 @@ public class EcpController {
@FormParam("password") String password, @Context HttpServletRequest request)
throws IOException, ServletException, RestInterfaceException {
return userLoginService.ecpLogin(regId, password, request.getLocalName());
return userLoginService.ecpLogin(regId, password, request.getServerName());
}
@Path("/regid-xml/{regid}")
......@@ -169,7 +169,7 @@ public class EcpController {
ECPResponse response = new ECPResponse();
try {
userLoginService.ecpLogin(regId, password, request.getLocalName());
userLoginService.ecpLogin(regId, password, request.getServerName());
}
catch (NoUserFoundException e) {
generateFailXml(response, 400, "ecp login failed", "user-not-found");
......
......@@ -28,7 +28,7 @@ public class UserController {
public Map<String, String> updateUserAsync(@PathParam("eppn") String eppn, @Context HttpServletRequest request)
throws IOException, RestInterfaceException, ServletException {
userUpdateService.updateUserAsync(eppn, request.getLocalName(), "rest-/user-admin/update-async/" + eppn);
userUpdateService.updateUserAsync(eppn, request.getServerName(), "rest-/user-admin/update-async/" + eppn);
Map<String, String> map = new HashMap<String, String>();
map.put("reuqest", "submitted");
......@@ -41,6 +41,6 @@ public class UserController {
public Map<String, String> updateUser(@PathParam("eppn") String eppn, @Context HttpServletRequest request)
throws IOException, RestInterfaceException, ServletException {
return userUpdateService.updateUser(eppn, request.getLocalName(), "rest-/user-admin/update/" + eppn);
return userUpdateService.updateUser(eppn, request.getServerName(), "rest-/user-admin/update/" + eppn);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment