public static final class SecurityFeature.Builder extends Object implements Builder<SecurityFeature>
SecurityFeature fluent API builder.| Modifier and Type | Method and Description |
|---|---|
SecurityFeature.Builder |
addQueryParamHandler(QueryParamHandler handler)
Add a new handler to extract query parameter and store it in security request header.
|
SecurityFeature.Builder |
addQueryParamHandlers(Iterable<QueryParamHandler> handlers)
Add handlers to extract query parameters and store them in security request header.
|
SecurityFeature.Builder |
authenticateAnnotatedOnly(boolean authnOnly)
Whether to authorize only annotated methods (with
Authenticated annotation or all. |
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 |
config(Config config)
Update this builder from configuration.
|
SecurityFeature.Builder |
debug()
Set debugging on.
|
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 only, defaults to falsepublic SecurityFeature.Builder authenticateAnnotatedOnly(boolean authnOnly)
Authenticated annotation or all.
When using usePrematchingAuthentication(boolean) this method is ignored.
By default only annotated methods (annotation may be also on Application class or resource class) are authenticated.authnOnly - if set to false, authentication will be performed for all requests, defaults to truepublic SecurityFeature.Builder addQueryParamHandler(QueryParamHandler handler)
handler - handler to extract datapublic SecurityFeature.Builder addQueryParamHandlers(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 config(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–2019 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms.