All Projects → catwell → lua-http-digest

catwell / lua-http-digest

Licence: MIT license
Client side HTTP Digest Authentication for Lua

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to lua-http-digest

Suravi
Suravi is a small distribution of Ravi/Lua 5.3 with batteries such as cjson, lpeglabel, luasocket, penlight, torch7, luv, luaossl
Stars: ✭ 56 (+211.11%)
Mutual labels:  luasocket
lua-twitter
A Lua twitter library that works with OpenResty or LuaSocket
Stars: ✭ 29 (+61.11%)
Mutual labels:  luasocket
defnet
Defold networking examples
Stars: ✭ 52 (+188.89%)
Mutual labels:  luasocket

http-digest

CI Status

Presentation

Small implementation of HTTP Digest Authentication (client-side) in Lua that mimics the API of LuaSocket.

Only supports auth/MD5, no reuse of client nonce, pull requests welcome.

Dependencies

  • luasocket
  • md5

Tests require cwtest, a JSON parser and the availability of httpbingo.org.

Usage

See LuaSocket's http.request. Credentials must be contained in the URL. Both the simple and generic interface are supported. Here is an example with the simple interface:

local http_digest = require "http-digest"
local url = "http://user:[email protected]/digest-auth/auth/user/passwd"
local b, c, h = http_digest.request(url)

See the tests for more.

Other compatible http clients (like Copas or LuaSec) can be used as well. To use another http client replace the default one:

local http_digest = require "http-digest"
http_digest.http = require "copas.http"

Contributors

Copyright

  • Copyright (c) 2012-2013 Moodstocks SAS
  • Copyright (c) 2014-2022 Pierre Chapuis
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].