Skip to content

Commit

Permalink
Added docs for WAMP-CRA
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Burkalev authored and Konstantin Burkalev committed Feb 6, 2018
1 parent cea2054 commit 9a8d8a4
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,24 @@ but WAMP session establishment is in progress.
Challenge Response Authentication
------------------------------------------

TBD
Loowy supports challenge response authentication. To use it you need to provide authid and onChallenge callback
as instance options. See example below:

```lua
local loowy = require 'loowy.client'

local client = loowy.new("ws://ws.wamp.server.url", {
transportEncoding = 'json',
realm = 'AppRealm',
authid = 'user1',
authmethods = { 'wampcra' },
onChallenge = function (method, info)
local hmac = require "resty.hmac"
local hm = hmac:new("secret1")
return hm:generate_signature("sha256", info.challenge)
end
})
```

[Back to TOC](#table-of-contents)

Expand Down

0 comments on commit 9a8d8a4

Please sign in to comment.