ntlm
Version, currently 1.0.02 versions
- 1.0.1latestMar 22, 2021
- 1.0.0not indexedMay 25, 2021
github.com/spider-gazelle/ntlm
NTLM authentication for crystal lang
Nothing has been indexed for 1.0.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
ntlm:
github: spider-gazelle/ntlm
version: ~> 1.0.0Then run:
shards installshard.yml
No shard.yml has been indexed for 1.0.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
Crystal Lang NTLM Auth
Communicate with servers that implement NTLM auth.
Installation
-
Add the dependency to your
shard.yml:dependencies: ntlm: github: spider-gazelle/ntlm -
Run
shards install
Usage
Authenticate a HTTP request
require "http/client"
require "ntlm"
route = "/terrible/soap/api"
username = "username"
password = "password"
# NOTE:: domain is not always required, this can sometimes be left `nil`
domain = "DOMAIN"
client = HTTP::Client.new "corporate.service"
response = client.get route
if response.status_code == 401 && response.headers["WWW-Authenticate"]?
supported = response.headers.get("WWW-Authenticate")
raise "doesn't support NTLM auth: #{supported}" unless supported.includes?("NTLM")
# Negotiate NTLM
response = client.get route, HTTP::Headers{"Authorization" => NTLM.negotiate_http(domain)}
# Extract the challenge
raise "unexpected response #{response.status_code}" unless response.status_code == 401 && response.headers["WWW-Authenticate"]?
challenge = response.headers["WWW-Authenticate"]
# Authenticate the client
response = client.get route, HTTP::Headers{"Authorization" => NTLM.authenticate_http(challenge, username, password)}
end
response
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
1.0.0- Tagged
- May 25, 2021
- Commit
b23887db70ce- Indexed
- not yet
Dependents
Repository
github.com/spider-gazelle/ntlm
Metadata
- Created
- Aug 12, 2026
- Updated
- Sep 30, 2026
- Synced
- Sep 30, 2026
- Versions
- 2