Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

401 Unauthorized response with valid credentials #23

Open
denysenkodaniil opened this issue Sep 22, 2022 · 1 comment
Open

401 Unauthorized response with valid credentials #23

denysenkodaniil opened this issue Sep 22, 2022 · 1 comment

Comments

@denysenkodaniil
Copy link

Hello!

Just wanted to give a heads up to save debugging time for anyone getting 401 Unauthorized response when using valid credentials.

In readme it says:

 Transport: &httpntlm.NtlmTransport{
            Domain:   "mydomain",   <--- line in question
            User:     "testuser",
            Password: "fish",
...

When I specify domain (like Domain: "my-domain-here",) I receive status code 401. But when I leave it as an empty string (like Domain: "",) I pass authorization. I used same credentials and request URL both times, via HTTPS.

I don't know why it is so, but, well, it is. I'm not all that familiar with NTLM, so maybe I'm just missing something.
If anyone can provide useful info on the subject - please do so.

p.s. I thank the contributors for the library!

@flipyap
Copy link

flipyap commented Aug 25, 2023

I know this is a year late response, but figured i'd at least point out that the fact that the domain here is not the full "domain" , but rather the TLD for the AD domain you are working with. If you give it something like a hostname or subdomain its going to fail as it used the domain in the challenge request as seen here: https://github.com/vadimi/go-ntlm/blob/main/ntlm/ntlmv2.go#L352

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants