如何在CentOS中使用Restlet通过HTTP NTLM进行身份验证?

如何在CentOS中使用Restlet通过HTTP NTLM进行身份验证?,rest,dynamics-crm-2011,restlet,Rest,Dynamics Crm 2011,Restlet,我在CRM Dynamics中通过REST进行身份验证时遇到问题。这个问题只有在我尝试连接时才会发生 从一台装有CentOS的机器(在Ubuntu和Windows中工作) Tiago Martins您应该使用网络连接器并呼叫: // Create your own authenticator Authenticator a = new Authenticator() { public PasswordAuthentication getPasswordAuthentication() {

我在CRM Dynamics中通过REST进行身份验证时遇到问题。这个问题只有在我尝试连接时才会发生 从一台装有CentOS的机器(在Ubuntu和Windows中工作)


Tiago Martins

您应该使用网络连接器并呼叫:

// Create your own authenticator
Authenticator a = new Authenticator() {
    public PasswordAuthentication getPasswordAuthentication() {
        return (new PasswordAuthentication("<your account>", "<your password>".toCharArray()));
    }
};

// Sets the default Authenticator
Authenticator.setDefault(a);
//创建自己的验证器
验证器a=新验证器(){
公共密码身份验证getPasswordAuthentication(){
返回(新密码身份验证(“,”.tocharray());
}
};
//设置默认验证器
Authenticator.setDefault(a);
有关说明,请参见:

Client: CentOS 5.6
Client: Windows 7 SP1
Server AD: Windows Server 2008 R2
CRM Dynamics 2011
Restlet 2.1
JBoss 7.1.1
Java SE 6
// Create your own authenticator
Authenticator a = new Authenticator() {
    public PasswordAuthentication getPasswordAuthentication() {
        return (new PasswordAuthentication("<your account>", "<your password>".toCharArray()));
    }
};

// Sets the default Authenticator
Authenticator.setDefault(a);