HttpAuthentication.createPreemptiveBasicAuthentication

BasicAuthentication does not support preemptive authentication out of the box, because if misused or used incorrectly the preemptive authentication can lead to significant security issues, such as sending user credentials in clear text to an unauthorized third party. Therefore, users are expected to evaluate potential benefits of preemptive authentication versus security risks in the context of their specific application environment.

Returns a BasicAuthentication object that sends the Authorization header with the request without the requirement of a challenge.

Example:

 var auth = HttpAuthentication.createPreemptiveBasicAuthentication("username", "password");
 var response = services.rest.get(.., .., .., auth);
 

returns BasicAuthentication

Parameters

java.lang.String  username,  java.lang.String  password,