public class AuthUtils extends Object
| Constructor and Description |
|---|
AuthUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
encode64(String value) |
static AuthenticationDto |
getForAuthorizationHeader(String dtoName,
String authorizationValue)
DTO representing the use of authentication via the "Authorization" header
|
static AuthenticationDto |
getForBasic(String dtoName,
String userId,
String password)
DTO representing the use of authentication via HTTP Basic (RFC-7617)
|
static AuthenticationDto |
getForDefaultSpringFormLogin(String dtoName,
String username,
String password)
DTO representing the use of authentication via a X-WWW-FORM-URLENCODED POST submission.
|
static AuthenticationDto |
getForDefaultSpringFormLogin(String dtoName,
String username,
String password,
String endpoint)
DTO representing the use of authentication via a X-WWW-FORM-URLENCODED POST submission.
|
static AuthenticationDto |
getForJsonToken(String dtoName,
String postEndpoint,
String payload,
String extractFromField,
String headerPrefix) |
static AuthenticationDto |
getForJsonToken(String dtoName,
String postEndpoint,
String payload,
String extractFromField,
String headerPrefix,
String contentType)
Creates an AuthenticationDto object configured to obtain a JSON token from a login endpoint.
|
static AuthenticationDto |
getForJsonTokenBearer(String dtoName,
String postEndpoint,
String payload,
String extractFromField) |
static AuthenticationDto |
getForJWT(String dtoName,
String postEndpoint,
String payload,
String extractFromField) |
public static AuthenticationDto getForBasic(String dtoName, String userId, String password)
dtoName - a name used to identify this dto. Mainly needed for debugginguserId - the id of a userpassword - password for that userpublic static AuthenticationDto getForAuthorizationHeader(String dtoName, String authorizationValue)
dtoName - a name used to identify this dto. Mainly needed for debuggingauthorizationValue - the content of the "Authorization" headerpublic static AuthenticationDto getForDefaultSpringFormLogin(String dtoName, String username, String password)
dtoName - a name used to identify this dto. Mainly needed for debuggingusername - the id of a userpassword - password for that userpublic static AuthenticationDto getForDefaultSpringFormLogin(String dtoName, String username, String password, String endpoint)
dtoName - a name used to identify this dto. Mainly needed for debuggingusername - the id of a userpassword - password for that userendpoint - the url of the endpoint to use for the loginpublic static AuthenticationDto getForJWT(String dtoName, String postEndpoint, String payload, String extractFromField)
public static AuthenticationDto getForJsonTokenBearer(String dtoName, String postEndpoint, String payload, String extractFromField)
public static AuthenticationDto getForJsonToken(String dtoName, String postEndpoint, String payload, String extractFromField, String headerPrefix)
public static AuthenticationDto getForJsonToken(String dtoName, String postEndpoint, String payload, String extractFromField, String headerPrefix, String contentType)
dtoName - The name to assign to the AuthenticationDtopostEndpoint - The endpoint URL or path (see description above for interpretation)payload - The request payload to send to the login endpointextractFromField - The field in the response that contains the tokenheaderPrefix - The prefix to add to the token (e.g., "Bearer ")contentType - The content type to use for the requestCopyright © 2016–2025. All rights reserved.