Skip to Content
Spring徹底入門 第2版  Spring FrameworkによるJavaアプリケーション開発
book

Spring徹底入門 第2版 Spring FrameworkによるJavaアプリケーション開発

by 株式会社NTTデータ, 株式会社NTTデータグループ
May 2024
Intermediate to advanced
752 pages
24h
Japanese
Shōeisha
Content preview from Spring徹底入門 第2版 Spring FrameworkによるJavaアプリケーション開発
426
SpringSecurity
9
SpringSecurity から提供されている XML ネームスペースを有効にする。上記の例では、
sec
という名前を割り当て
ている。
XML ネームスペースを使用すると、SpringSecurity のコンポーネントの Bean 定義を簡単に行なうことがで
きる
<sec:http>
要素を定義する。
<sec:http>
要素を定義すると、SpringSecurityを利用するために必要となるコンポー
ネントの
Bean 定義が自動的に行なわれる
ここではセットアップの疎通確認を行なうために、すべてのパスに対して認証が必要となる認可設定を行ない、
フォーム認証機能を有効化している
<sec:authentication-manager>
要素を定義して、認証機能用のコンポーネントをBean 定義する。この要素を定
義しておかないとサーバー起動時にエラーが発生してしまう
セキュリティ対策が不要なリソース(
CSS
JavaScript
など)がある場合は、以下のような
Bean
定義を行な
い、
Spring Security
の処 理を適用しないようにします。なお、複 数の
<sec:http>
要素を定義する場合、定義し
た順にパスと
pattern
のマッチングが行なわれるため、以下の設定は「
XML
ファイル(
security-context.xml
の作成例」で設定した
<sec:http>
要素よりも前に記述する必要があります。
SpringSecurity ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

AWSではじめるインフラ構築入門 第2版 安全で堅牢な本番環境のつくり方

AWSではじめるインフラ構築入門 第2版 安全で堅牢な本番環境のつくり方

中垣 健志

Publisher Resources

ISBN: 9784798187105