mp.security.security.adoc Maven / Gradle / Ivy
///////////////////////////////////////////////////////////////////////////////
Copyright (c) 2018, 2024 Oracle and/or its affiliates.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
///////////////////////////////////////////////////////////////////////////////
= Adding Security
:description: Helidon MicroProfile security
:keywords: helidon, microprofile, micro-profile
:feature-name: Security
:rootdir: {docdir}/../..
include::{rootdir}/includes/mp.adoc[]
To add security, such as protecting
resource methods with authentication, to a MicroProfile application, add the Helidon
security integration dependency to your project.
include::{rootdir}/includes/dependencies.adoc[]
[source,xml]
----
io.helidon.microprofile
helidon-microprofile-security
----
=== Securing a JAX-RS Resource
For JAX-RS resources, declare security by adding annotations to a resource class or
method.
[source,java]
.Protected resource method
----
include::{sourcedir}/mp/security/SecuritySnippets.java[tag=snippet_1, indent=0]
----
Security in Helidon MicroProfile is built on top of Jersey's and can be enabled/disabled
using the property `security.jersey.enabled=[true|false]`.
include::{rootdir}/includes/security/helidon-endpoints.adoc[]
© 2015 - 2025 Weber Informatics LLC | Privacy Policy