Announcement Announcement Module
Collapse
No announcement yet.
channelProcessingFilter, https -> http redirection proble Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • channelProcessingFilter, https -> http redirection proble

    Hi everybody,
    Using
    - WSAD 5.1.2
    - Acegi 0.8.1
    - Spring 1.1.4
    My problem is with the channelProcessingFilter... In websphere if you don't define portMapper for SecureChannelProcessor, you'll always be redirected to login page... I defined portMappings so http to https redirection works but the reverse is not working. Browser stucks when trying to redirect from https to http... And one more thing the images in my login.jsp don't appear (I think it is because of the images are not in secure folder and they should be reached from http)...How can I define portMapping for https to http redirection?... Thanks in advance....

    Code:
    <!-- channelProcessingFilter -->
       <bean id="channelProcessingFilter" class="net.sf.acegisecurity.securechannel.ChannelProcessingFilter">
          <property name="channelDecisionManager"><ref local="channelDecisionManager"/></property>
          <property name="filterInvocationDefinitionSource">
             <value>
    			    CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
    				\A/secure/.*\Z=REQUIRES_SECURE_CHANNEL
    				\A/secure/login.jsp.*\Z=REQUIRES_SECURE_CHANNEL
    				\A/j_acegi_security_check.*\Z=REQUIRES_SECURE_CHANNEL
    				\A.*\Z=REQUIRES_INSECURE_CHANNEL
             </value>
          </property>
       </bean>
    
       <bean id="channelDecisionManager" class="net.sf.acegisecurity.securechannel.ChannelDecisionManagerImpl">
          <property name="channelProcessors">
             <list>
                <ref local="secureChannelProcessor"/>
                <ref local="insecureChannelProcessor"/>
             </list>
          </property>
       </bean>
    Code:
    <!--SecureChannelProcessor -->
    <bean id="secureChannelProcessor" class="net.sf.acegisecurity.securechannel.SecureChannelProcessor">
    	   <property name="entryPoint"> 
    		   <ref local="retryWithHttpsEntryPoint"/> 
    	   </property> 
       </bean>
    	<bean id="retryWithHttpsEntryPoint" class="net.sf.acegisecurity.securechannel.RetryWithHttpsEntryPoint"> 
    		<property name="portMapper"> 
    			<ref local="portMapper"/> 
    		</property> 
    	</bean>
    	<bean id="portMapper" class="net.sf.acegisecurity.util.PortMapperImpl"> 
    		<property name="portMappings"> 
    			<map> 
    				<entry key="80"><value>9443</value></entry>
    				<entry key="9080"><value>9443</value></entry> 
    			</map> 
    		</property> 
    	</bean>
    Code:
    <!--InsecureChannelProcessor -->
       <bean id="insecureChannelProcessor" class="net.sf.acegisecurity.securechannel.InsecureChannelProcessor">
    	   <property name="entryPoint"> 
    		   <ref local="retryWithHttpEntryPoint"/> 
    	   </property>    
       </bean>
    	<bean id="retryWithHttpEntryPoint" class="net.sf.acegisecurity.securechannel.RetryWithHttpEntryPoint"> 
    		<property name="portMapper"> 
    			<ref local="portMapper2"/> 
    		</property> 
    	</bean>
    	<bean id="portMapper2" class="net.sf.acegisecurity.util.PortMapperImpl"> 
    		<property name="portMappings"> 
    			<map> 
    <!--!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-->
    <!-- I am not sure if the following entry is right or wrong, doesn't work however... -->
    				<entry key="9443"><value>9080</value></entry>
    
    			</map> 
    		</property> 
    	</bean>

  • #2
    Take a look at the PortMapperImpl JavaDocs.

    You should only need one PortMapperImpl. The config is HTTP:HTTPS pair for each key/value mapping. Therefore, your portMapper2 is incorrect as I presume 9443 is HTTPS. I would try removing the 80:9443 mapping in your portMapper and see if it helps (ie just get 9080:9443 working initially, then add port 80:443 if needed).

    Comment

    Working...
    X