Announcement Announcement Module
Collapse
No announcement yet.
acegi interception Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • acegi interception

    hai.

    Thanks for everyone who read over this thread.
    I have a application which should bring welcome.jsp after login and registration.
    I am using acegi for login authentication.
    my flow is home---login--welcome.jsp
    also i have to do home--register--welcome.jsp
    Is it possible to do.
    Login authentication is successful. but when registration, after registration login is intercepting, as home--register--login--welcome.

    can i have welcome in both the use case.
    what can i do in this case for login not to intercept.

    Thanks for everyone who think over this.

  • #2
    Originally posted by selvam View Post
    hai.

    Thanks for everyone who read over this thread.
    I have a application which should bring welcome.jsp after login and registration.
    I am using acegi for login authentication.
    my flow is home---login--welcome.jsp
    also i have to do home--register--welcome.jsp
    Is it possible to do.
    Login authentication is successful. but when registration, after registration login is intercepting, as home--register--login--welcome.

    can i have welcome in both the use case.
    what can i do in this case for login not to intercept.

    Thanks for everyone who think over this.
    This is normal behavior, because your registration process isn't probably forcing a login. If you want to auto login the user after the registration process completed succesfully, you need to do this programmaticaly.

    For example:
    Code:
    SecurityContext context = SecurityContextHolder.getContext();
    GrantedAuthority[] grantedAuthorities = new GrantedAuthority[]{new GrantedAuthorityImpl("ROLE_USER")};
    
    UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(username, password, grantedAuthorities);
    authentication.setDetails(request.getRemoteAddr());
    
    ProviderManager pm = (ProviderManager) WebApplicationContextUtils.getWebApplicationContext(getServlet().getServletContext()).getBean("authenticationManager");
    pm.doAuthentication(authentication);
    context.setAuthentication(authentication);

    Comment

    Working...
    X