AW: [jcifs] Member in Domain?
Müller Jens
Jens.Mueller at dbv-winterthur.de
Mon Dec 9 21:41:19 EST 2002
Hi Eric,
I tried to generate an UniAdress-Object with:
UniAddress domainController = UniAddress.getByName("NAME-OF-DC");
It takes about 5 seconds, until I get an object. (is it normal?)
With this object I called the method below and received the following
exception:
jcifs.smb.SmbAuthException: Access denied
Do you have an idea, what could be the reason for it?
Regards
Jens
> If you have obtained a non-null NtlmPasswordAuthentication object from the
> doAuthentication call (i.e., the client has responded with a well-formed
type-3
> message), and you want to check if the response will successfully
authenticate
> them against a specific domain, you should be able to do:
>
> public boolean isInDomain(NtlmPasswordAuthentication np,
> UniAddress domainController, String domain) throws IOException {
> try {
> if (!domain.equalsIgnoreCase(np.getDomain())) return false;
> SmbSession.logon(domainController, np);
> return true;
> } catch (SmbAuthException ex) {
> return false;
> }
> }
>
> The domainController above should be the same box which produced the
type-2
> challenge, i.e. via SmbSession.getChallenge(domainController)
>
> Eric
More information about the jcifs
mailing list