2011-12-07 21 views
1

私がしましたspring security core pluginGrailsの春のセキュリティ問題

に問題I Excelスプレッドシートと1つのセルは、私のWebアプリケーションのリソースへのリンクを持っていました(例えば。http://localhost:8080/myapp/item/1

私がリンクをクリックすると、ブラウザー(すでにログインしている場所と同じ)が開き、クリックしたURLに行く代わりに、私は家に帰宅します(デフォルトのターゲットURL)...

私はbeanのauthenticationProcessingFilterを変更しました。doFilterで何が起こっているのかを記録しています。これは私が得たものです

http://localhost:8080/myapp/item/1 
E5E79669EBC938953AC6DCA4F1D38D56 <- this is the session id 
false <- just printing if I'm logged in 
http://localhost:8080/myapp/login/auth 
1446A2704FC61E6304F0AC95F8BDAF22 <- this is the session id, and now is different 
true <- just printing if I'm logged in 
http://localhost:8080/myapp/home 
1446A2704FC61E6304F0AC95F8BDAF22 <- this is the session id 
true <- just printing if I'm logged in 

それはセッションIDを変更する理由を私は知らない、これがすべてでは

public class MyAuthFilter extends RequestHolderAuthenticationFilter { 

    @Override 
    public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException { 
     HttpServletRequest r2 = (HttpServletRequest)request; 
     println r2.getSession().getId(); 
     super.doFilter(request, response, chain); 
    } 
} 

がどのように私は私がクリックされたURLにリダイレクトすることができますUsernamePasswordAuthenticationFilterのオーバーライドのdoFilterになりますか?

答えて

0

IDが変更されたセッションの理由は、セッション固定し、セッションIDを変更するためのgrails forum

smakelaのおかげ理由は、「セッション固定」を防ぐためです。

http://en.wikipedia.org/wiki/Session_fixation

http://grails-plugins.github.com/grails-spring-security-core/docs/manual/guide/19%20Session%20Fixation%20Prevention.html

[OK]を私は....私がmyappのような安全でないURLにアクセスしてください

の代わりに、myappにしようとして/アイテム/ 1

をそれを修正coud/item/load/1

と私は何かのような"アイテムを読み込む"、次にjavascriptでmyapp/item/1にリダイレクト

ありがとう

関連する問題