Permalink
Browse files

Update weakforced example

  • Loading branch information...
Harrens committed Sep 19, 2018
1 parent a280072 commit 6a40e279f23920bec9f2590a6e0d90ea190d13da
Showing with 23 additions and 1 deletion.
  1. +23 −1 lookup/weakforced/README.md
@@ -69,4 +69,26 @@ Send any kind of available command to the weakforced service.
- password `string` - The password that was used.
- trunclen `number` - Truncate the hashed password by bits, by default it will use full length.

**Returns**: `string`
**Returns**: `string`

## Example

```java
$wfuser = WforcedUser($saslusername, $saslpassword, $senderip, ["attrs" => ["policyclient" => $serverip]]);
$wf = Wforced(["url" => "http://172.16.78.25", "port" => 8084, "username" => "admin", "password" => "admin"]);
switch ($wf->allow($wfuser)) {
case 0:
if (validate_credentials($saslusername, $saslpassword) == 1) {
$wf->report($wfuser, true);
Accept();
} else {
$wf->report($wfuser, false);
Reject();
}
case -1:
Reject();
default:
Defer();
}
```

0 comments on commit 6a40e27

Please sign in to comment.