0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Spring Securityを使いたい

Posted at

フレームワークのアーキテクチャ

1.クライアントからのリクエスト
2.FilterChainProxyクラスがリクエストを受け取って、HttpFirewallインターフェースのメソッドを使ってHttpServletRequestとHttpServletResponseにファイヤーウォールの機能を搭載する
3.FilterChainProxyクラスからSecurityFilterChainクラスに処理を任せる
※SecurityFilterChainには何層にもフィルターが重なっていて、それを順々に通っていく。ろ過されていくイメージ。
5.ろ過されて出てきたものは後続処理を終えて、Webアプリケーションのリソースの中に渡されていく
6.[2]のFilterChainProxyクラスはWebアプリケーションから返却されたリソースをクライアントに返却する

FilterChainProxy

フレームワーク処理の司令塔

HttpFirewall

HttpServletRequestとHttpServletResponseにファイヤーウォールを教えてあげる先生

SecurityFilterChain

ろ過器
中身にろ過成分が入っている
あくまで器

xmlでのBean定義法
<sec:http pattern="/ui/**">
    中身
</sec:http>

<sec:http pattern="上と同じようにパスを入れる">
</sec:http>

こうやって何層にもフィルターを設定していってあげる

Security Filter

ろ過成分
サーブレットフィルタクラス

まとめ

こうやってSpring Securityはできています。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?