Package org.openhab.core.io.rest.auth
Class AuthFilter
java.lang.Object
org.openhab.core.io.rest.auth.AuthFilter
- All Implemented Interfaces:
javax.ws.rs.container.ContainerRequestFilter
@PreMatching
@Priority(1000)
@Provider
@NonNullByDefault
public class AuthFilter
extends Object
implements javax.ws.rs.container.ContainerRequestFilter
This filter is responsible for parsing credentials provided with a request, and hydrating a
SecurityContext
from these credentials if they are valid.- Author:
- Yannick Schaus - initial contribution, Yannick Schaus - Allow basic authentication, Yannick Schaus - Add support for API tokens, Sebastian Gerber - Add basic auth caching, Kai Kreuzer - Add null annotations, constructor initialization, Miguel Álvarez - Add trusted networks for implicit user role
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAuthFilter
(org.openhab.core.io.rest.auth.internal.JwtHelper jwtHelper, UserRegistry userRegistry) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
void
filter
(@Nullable javax.ws.rs.container.ContainerRequestContext requestContext) @Nullable javax.ws.rs.core.SecurityContext
getSecurityContext
(javax.servlet.http.HttpServletRequest request, boolean allowQueryToken) protected void
-
Field Details
-
CONFIG_URI
- See Also:
-
-
Constructor Details
-
AuthFilter
public AuthFilter(org.openhab.core.io.rest.auth.internal.JwtHelper jwtHelper, UserRegistry userRegistry)
-
-
Method Details
-
activate
-
modified
-
deactivate
protected void deactivate() -
filter
public void filter(@Nullable javax.ws.rs.container.ContainerRequestContext requestContext) throws IOException - Specified by:
filter
in interfacejavax.ws.rs.container.ContainerRequestFilter
- Throws:
IOException
-
getSecurityContext
public @Nullable javax.ws.rs.core.SecurityContext getSecurityContext(javax.servlet.http.HttpServletRequest request, boolean allowQueryToken) throws AuthenticationException, IOException - Throws:
AuthenticationException
IOException
-