LDAP를 사용하는 경우 Basic과 같이 인증이 전달 될 수 있습니다. 사용자 이름과 암호를 알고있는 경우, 헤더 "Authorization"에 "Basic base64_token"값을 추가하십시오.
base64 토큰은 사용자 이름과 암호를 username : password 형식으로 base64로 인코딩 한 문자열입니다. 이상적으로는 이것이 효과적 일 것입니다. 작동하지 않는지 알려주세요. 이 경우 SPNEGO를 사용하여 옵션을 탐색 할 수 있습니다. JAVA에서 LDAP에 대한
는
코드 :
public class Main
{
public static void main(String[] args)
{
//Replace username and password with your username and password
token = Base64.getEncoder().encodeToString((username + ":" + password).getBytes())
conn = (HttpURLConnection) endpoint.openConnection();
// Set the necessary header fields, which in this case is Basic
conn.addRequestProperty("Authorization", "Basic " + token);
//Continue to do what you want to do after this. This should authenticate
// you to the server
}
}