Properly set subject locality
authorlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 3 Jul 2007 22:40:48 +0000 (22:40 +0000)
committerlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 3 Jul 2007 22:40:48 +0000 (22:40 +0000)
Backout changes to allowed overriding address (misunderstood that this was supposed to be the user-agent address)

git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@2294 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/idp/profile/saml1/ShibbolethSSOProfileHandler.java
src/edu/internet2/middleware/shibboleth/idp/profile/saml2/SSOProfileHandler.java

index 2b3824f..1b38044 100644 (file)
@@ -402,20 +402,9 @@ public class ShibbolethSSOProfileHandler extends AbstractSAML1ProfileHandler {
     protected SubjectLocality buildSubjectLocality(ShibbolethSSORequestContext requestContext) {
         SubjectLocality subjectLocality = subjectLocalityBuilder.buildObject();
 
     protected SubjectLocality buildSubjectLocality(ShibbolethSSORequestContext requestContext) {
         SubjectLocality subjectLocality = subjectLocalityBuilder.buildObject();
 
-        ShibbolethSSOConfiguration profileConfig = requestContext.getProfileConfiguration();
         HttpServletRequest httpRequest = (HttpServletRequest) requestContext.getProfileRequest().getRawRequest();
         HttpServletRequest httpRequest = (HttpServletRequest) requestContext.getProfileRequest().getRawRequest();
-
-        if (profileConfig.getLocalityAddress() != null) {
-            subjectLocality.setIPAddress(profileConfig.getLocalityAddress());
-        } else {
-            subjectLocality.setIPAddress(httpRequest.getLocalAddr());
-        }
-
-        if (profileConfig.getLocalityDNSName() != null) {
-            subjectLocality.setDNSAddress(profileConfig.getLocalityDNSName());
-        } else {
-            subjectLocality.setDNSAddress(httpRequest.getLocalName());
-        }
+        subjectLocality.setIPAddress(httpRequest.getRemoteAddr());
+        subjectLocality.setDNSAddress(httpRequest.getRemoteHost());
 
         return subjectLocality;
     }
 
         return subjectLocality;
     }
index f676d5b..c6de865 100644 (file)
@@ -442,20 +442,9 @@ public class SSOProfileHandler extends AbstractSAML2ProfileHandler {
     protected SubjectLocality buildSubjectLocality(SSORequestContext requestContext) {
         SubjectLocality subjectLocality = subjectLocalityBuilder.buildObject();
 
     protected SubjectLocality buildSubjectLocality(SSORequestContext requestContext) {
         SubjectLocality subjectLocality = subjectLocalityBuilder.buildObject();
 
-        SSOConfiguration profileConfig = requestContext.getProfileConfiguration();
         HttpServletRequest httpRequest = (HttpServletRequest) requestContext.getProfileRequest().getRawRequest();
         HttpServletRequest httpRequest = (HttpServletRequest) requestContext.getProfileRequest().getRawRequest();
-
-        if (profileConfig.getLocalityAddress() != null) {
-            subjectLocality.setAddress(profileConfig.getLocalityAddress());
-        } else {
-            subjectLocality.setAddress(httpRequest.getLocalAddr());
-        }
-
-        if (profileConfig.getLocalityDNSName() != null) {
-            subjectLocality.setDNSName(profileConfig.getLocalityDNSName());
-        } else {
-            subjectLocality.setDNSName(httpRequest.getLocalName());
-        }
+        subjectLocality.setAddress(httpRequest.getRemoteAddr());
+        subjectLocality.setDNSName(httpRequest.getRemoteHost());
 
         return subjectLocality;
     }
 
         return subjectLocality;
     }