Announcement Announcement Module
Collapse
No announcement yet.
problem with hiding the url of entry-point Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • problem with hiding the url of entry-point

    Hello,

    I have the following problem:

    I am using Spring Security and my entry-point is

    <security:form-login login-page="/index.htm" default-target-url="/start.htm" always-use-default-target="true" authentication-failure-url="/index.htm" />

    So when I am starting my tomcat and go to localhost:8080 and then he redirect automatically to index.htm

    So far so good that the correct behavior. But in my case I do not want to see this localhost:8080/index.htm in the browser, but only localhost:8080

    Is there a possiblity with this redirect without displaying the URL in the browser?

  • #2
    I assume you mean you want to forward to the login url as apposed to perform a redirect? Checkout LoginUrlAuthenticationEntryPoint and the useForward attribute. You can then specify the AuthenticationEntryPoint using http@entry-point-ref.

    Comment


    • #3
      That is working now with the forward, many thanks!

      Now my last problem: When I call a secured URL with no user login, it is now not jumping to my entry point anymore.

      My configuration is the following one:

      <security:http entry-point-ref="loginUrlAuthenticationEntryPoint" auto-config="true" use-expressions="true" disable-url-rewriting="true">
      <security:intercept-url pattern="/user/**" access="hasRole('ROLE_USER')" />
      <security:form-login login-page="/index.htm" default-target-url="/start.htm" always-use-default-target="true" authentication-failure-url="/index.htm" />
      <security:logout />
      <session-management session-authentication-strategy-ref="sas" />
      </security:http>

      <beans:bean id="loginUrlAuthenticationEntryPoint"
      class="org.springframework.security.web.authentica tion.LoginUrlAuthenticationEntryPoint">
      <beansroperty name="loginFormUrl" value="/index.htm" />
      <beansroperty name="useForward" value="true" />
      </beans:bean>

      My call of /user/home.htm without any user login do not correctly redirect to my index.htm, but open the /user/home.htm which is actually not permitted.

      What might the failure here? Before I am using the entry-point everything has gone well.

      Comment

      Working...
      X