クラス AuthorizeHttpRequestsConfigurer.AuthorizedUrl
java.lang.ObjectSE
org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer.AuthorizedUrl
- 含まれているクラス:
- AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder<H>>
RequestMatcher
用に AuthorizationManager
を構成できるようにするオブジェクト。ネストされたクラスのサマリー
ネストされたクラスメソッドのサマリー
修飾子と型メソッド説明カスタムAuthorizationManager
を指定できます。匿名ユーザーが URL を許可することを指定します。認証されたユーザーが URL を許可することを指定します。denyAll()
URL が誰にも許可されていないことを指定します。認証され、「記憶」されていないユーザーが URL を許可することを指定します。protected ListSE<? extends RequestMatcher>
hasAnyAuthority
(StringSE... authorities) ユーザーが多くの権限の 1 つを必要とすることを指定します。hasAnyRole
(StringSE... roles) ユーザーが多くのロールの 1 つを必要とすることを指定します。hasAuthority
(StringSE authority) ユーザーに権限が必要であることを指定します。ユーザーにロールが必要であることを指定します。hasVariable
(StringSE variable) 比較する URL 内のパス変数を指定します。not()
次の認可ルールを否定します。URL が誰でも許可されていることを指定します。記憶されているユーザーが URL を許可することを指定します。
メソッドの詳細
getMatchers
not
次の認可ルールを否定します。- 戻り値:
- さらなるカスタマイズのための
AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder<H>>.AuthorizedUrl
- 導入:
- 6.3
permitAll
URL が誰でも許可されていることを指定します。- 戻り値:
- さらなるカスタマイズのための
AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder<H>>.AuthorizationManagerRequestMatcherRegistry
denyAll
URL が誰にも許可されていないことを指定します。- 戻り値:
- さらなるカスタマイズのための
AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder<H>>.AuthorizationManagerRequestMatcherRegistry
hasRole
public AuthorizeHttpRequestsConfigurer<H>.AuthorizationManagerRequestMatcherRegistry hasRole(StringSE role) ユーザーにロールが必要であることを指定します。- パラメーター:
role
- 自動的に ROLE_ が付加される必要なロール(つまり、USER、ADMIN など)。ROLE_ で始まるべきではありません- 戻り値:
- さらにカスタマイズするための
AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder<H>>.AuthorizationManagerRequestMatcherRegistry
hasAnyRole
public AuthorizeHttpRequestsConfigurer<H>.AuthorizationManagerRequestMatcherRegistry hasAnyRole(StringSE... roles) ユーザーが多くのロールの 1 つを必要とすることを指定します。- パラメーター:
roles
- ユーザーが少なくとも 1 つ持つ必要のあるロール(つまり、ADMIN、USER など)。各ロールはすでに自動的に追加されるため、ROLE_ で開始しないでください- 戻り値:
- さらなるカスタマイズのための
AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder<H>>.AuthorizationManagerRequestMatcherRegistry
hasAuthority
public AuthorizeHttpRequestsConfigurer<H>.AuthorizationManagerRequestMatcherRegistry hasAuthority(StringSE authority) ユーザーに権限が必要であることを指定します。- パラメーター:
authority
- 必要な権限- 戻り値:
- さらなるカスタマイズのための
AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder<H>>.AuthorizationManagerRequestMatcherRegistry
hasAnyAuthority
public AuthorizeHttpRequestsConfigurer<H>.AuthorizationManagerRequestMatcherRegistry hasAnyAuthority(StringSE... authorities) ユーザーが多くの権限の 1 つを必要とすることを指定します。- パラメーター:
authorities
- ユーザーが少なくとも 1 つ持っている必要がある権限 (つまり、ROLE_USER、ROLE_ADMIN など)- 戻り値:
- さらなるカスタマイズのための
AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder<H>>.AuthorizationManagerRequestMatcherRegistry
authenticated
public AuthorizeHttpRequestsConfigurer<H>.AuthorizationManagerRequestMatcherRegistry authenticated()認証されたユーザーが URL を許可することを指定します。- 戻り値:
- さらなるカスタマイズのための
AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder<H>>.AuthorizationManagerRequestMatcherRegistry
fullyAuthenticated
public AuthorizeHttpRequestsConfigurer<H>.AuthorizationManagerRequestMatcherRegistry fullyAuthenticated()認証され、「記憶」されていないユーザーが URL を許可することを指定します。- 戻り値:
- さらなるカスタマイズのための
AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder<H>>.AuthorizationManagerRequestMatcherRegistry
- 導入:
- 5.8
- 関連事項:
rememberMe
記憶されているユーザーが URL を許可することを指定します。- 戻り値:
- さらなるカスタマイズのための
AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder<H>>.AuthorizationManagerRequestMatcherRegistry
- 導入:
- 5.8
- 関連事項:
anonymous
匿名ユーザーが URL を許可することを指定します。- 戻り値:
- さらなるカスタマイズのための
AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder<H>>.AuthorizationManagerRequestMatcherRegistry
- 導入:
- 5.8
hasVariable
public AuthorizeHttpRequestsConfigurer<H>.AuthorizedUrl.AuthorizedUrlVariable hasVariable(StringSE variable) 比較する URL 内のパス変数を指定します。以下に例を示します。
requestMatchers("/user/{username}").hasVariable("username").equalTo(Authentication::getName)
- パラメーター:
variable
- 比較する URL テンプレート内の変数。- 戻り値:
- さらにカスタマイズするには
AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder<H>>.AuthorizedUrl.AuthorizedUrlVariable
を使用します。 - 導入:
- 6.3
access
public AuthorizeHttpRequestsConfigurer<H>.AuthorizationManagerRequestMatcherRegistry access(AuthorizationManager<RequestAuthorizationContext> manager) カスタムAuthorizationManager
を指定できます。- パラメーター:
manager
- 使用するAuthorizationManager
- 戻り値:
- さらなるカスタマイズのための
AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder<H>>.AuthorizationManagerRequestMatcherRegistry