Class AuthUtils
- java.lang.Object
-
- org.evomaster.client.java.controller.AuthUtils
-
public class AuthUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description AuthUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringencode64(String value)static AuthenticationDtogetForAuthorizationHeader(String dtoName, String authorizationValue)DTO representing the use of authentication via the "Authorization" headerstatic AuthenticationDtogetForBasic(String dtoName, String userId, String password)DTO representing the use of authentication via HTTP Basic (RFC-7617)static AuthenticationDtogetForDefaultSpringFormLogin(String dtoName, String username, String password)DTO representing the use of authentication via a X-WWW-FORM-URLENCODED POST submission.
-
-
-
Method Detail
-
getForBasic
public static AuthenticationDto getForBasic(String dtoName, String userId, String password)
DTO representing the use of authentication via HTTP Basic (RFC-7617)- Parameters:
dtoName- a name used to identify this dto. Mainly needed for debugginguserId- the id of a userpassword- password for that user- Returns:
- a DTO
-
getForAuthorizationHeader
public static AuthenticationDto getForAuthorizationHeader(String dtoName, String authorizationValue)
DTO representing the use of authentication via the "Authorization" header- Parameters:
dtoName- a name used to identify this dto. Mainly needed for debuggingauthorizationValue- the content of the "Authorization" header- Returns:
- a DTO
-
getForDefaultSpringFormLogin
public static AuthenticationDto getForDefaultSpringFormLogin(String dtoName, String username, String password)
DTO representing the use of authentication via a X-WWW-FORM-URLENCODED POST submission. Assuming default names and endpoint used in SpringSecurity for default formLogin() configuration. When using this kind of DTO, EM will first do a POST on such endpoint with valid credentials, and then use the resulting cookie for the following HTTP requests.- Parameters:
dtoName- a name used to identify this dto. Mainly needed for debuggingusername- the id of a userpassword- password for that user- Returns:
- a DTO
-
-