Builder<SecurityFeature>public static final class SecurityFeature.Builder extends java.lang.Object implements Builder<SecurityFeature>
SecurityFeature fluent API builder.| Modifier and Type | Method | Description |
|---|---|---|
SecurityFeature.Builder |
addQueryParamHandler(QueryParamHandler handler) |
Add a new handler to extract query parameter and store it in security request header.
|
SecurityFeature.Builder |
addQueryParamHandlers(java.lang.Iterable<QueryParamHandler> handlers) |
Add handlers to extract query parameters and store them in security request header.
|
SecurityFeature.Builder |
authorizeAnnotatedOnly(boolean authzOnly) |
Whether to authorize only annotated methods (with
Authorized annotation) or all. |
SecurityFeature |
build() |
Build this configuration into an instance.
|
SecurityFeature.Builder |
debug() |
Set debugging on.
|
SecurityFeature.Builder |
fromConfig(Config config) |
Update this builder from configuration.
|
SecurityFeature.Builder |
usePrematchingAuthentication(boolean usePrematching) |
Configure whether pre-matching or post-matching filter is used to authenticate requests.
|
SecurityFeature.Builder |
usePrematchingAuthorization(boolean usePrematching) |
Configure whether pre-matching or post-matching filter is used to authorize requests.
|
public SecurityFeature.Builder authorizeAnnotatedOnly(boolean authzOnly)
Authorized annotation) or all.
When using usePrematchingAuthorization(boolean)
this method is ignored.authzOnly - if set to true, authorization will be performed on annotated methods onlypublic SecurityFeature.Builder addQueryParamHandler(QueryParamHandler handler)
handler - handler to extract datapublic SecurityFeature.Builder addQueryParamHandlers(java.lang.Iterable<QueryParamHandler> handlers)
handlers - handlers to extract datapublic SecurityFeature.Builder usePrematchingAuthentication(boolean usePrematching)
usePrematching - whether to use pre-matching filter instead of post-matchingpublic SecurityFeature.Builder usePrematchingAuthorization(boolean usePrematching)
usePrematching - whether to use pre-matching filter instead of post-matchingpublic SecurityFeature.Builder debug()
public SecurityFeature.Builder fromConfig(Config config)
authorizeAnnotatedOnly(boolean)addQueryParamHandler(QueryParamHandler)
security:
jersey:
defaults:
# If set to true, only annotated (@Authenticated) resources will be authorized
# By default, every request is sent to authorization provider
authorize-annotated-only: false
# query parameters will be extracted from request
# and sent to authentication and authorization providers
# as headers. These will NOT be available to application
# as headers.
query-params:
- name: "basicAuth"
header: "Authorization"
config - configuration set to key "jersey" (see example above)public SecurityFeature build()
build in interface Builder<SecurityFeature>Copyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.