public final class SecurityUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.util.Optional<java.lang.String> |
getCurrentUserJWT()
Get the JWT of the current user.
|
static java.util.Optional<java.lang.String> |
getCurrentUserLogin()
Get the login of the current user.
|
static boolean |
isAuthenticated()
Check if a user is authenticated.
|
static boolean |
isCurrentUserInRole(java.lang.String authority)
If the current user has a specific authority (security role).
|
public static java.util.Optional<java.lang.String> getCurrentUserLogin()
public static java.util.Optional<java.lang.String> getCurrentUserJWT()
public static boolean isAuthenticated()
public static boolean isCurrentUserInRole(java.lang.String authority)
The name of this method comes from the isUserInRole() method in the Servlet API
authority - the authority to checkCopyright © 2017 Osgiliath. All rights reserved.