Hi,
I am trying to implement my own authentication (and then authorisation) in restlet; but I am having some trouble. Hopefully someone can give me a hand; the doco seems somewhat out of date with respect to jax-rs.
I have a jax-rs restlet server that will receive a HTTP message that includes the final part of the HTTP_NTLM challenge/response process: type3 NTLM content inside the autheticate header.
I want my restlet to decode the type3 NTLM (I already have this code) and pull out the userId, domainName and workstationId and check them against the content of the URI and my own database. If they all match then the request should be processed.
The client code I have is:
ClientResource resource= new ClientResource(serverAddress);
ChallengeResponse challenge = new ChallengeResponse(ChallengeScheme.HTTP_NTLM, ntlmType3Data);
resource.setChallengeResponse(challenge);
Representation representation = resource.get();
The server code I have is:
component = new Component();
component.getServers().add(protocol, ipAddress, port);
JaxRsApplication application = new JaxRsApplication(component.getContext().createChildContext());
application.add(new MyApplication());
final MyAuthenticator guardMyApplication = new MyAuthenticator(application.getContext(), false, ChallengeScheme.HTTP_NTLM, "MyApp");
MyVerifier verifier = new MyVerifier();
guardMyApplication.setVerifier(verifier);
application.setGuard(guardMyApplication);
component.getDefaultHost().attach(application);
The MyAuthenticator class extends ChallengeAuthenticator and has no custom code in it.
The MyVerifier class extends Verifier and has an implementation for the verify() method. This is what I do in my verify() method:
ChallengeResponse cRes = request.getChallengeResponse();
String credentials = cRes.getCredentials();
String identifier = cRes.getIdentifier();
I get an exception when getCredentials() is called. This is a dead end for me because I need the data from the authorization header to do the verification.
I also get an warning message saying that restlet does not support HTTP_NTLM: "Challenge scheme HTTP_NTLM not supported by the Restlet engine."
I assume I havn't got this hooked together properly.
Can someone please help.
Thanks,
Ty
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2412883