{"action":"opened","issue":{"url":"https://api.github.com/repos/pritunl/pritunl/issues/80","labels_url":"https://api.github.com/repos/pritunl/pritunl/issues/80/labels{/name}","comments_url":"https://api.github.com/repos/pritunl/pritunl/issues/80/comments","events_url":"https://api.github.com/repos/pritunl/pritunl/issues/80/events","html_url":"https://github.com/pritunl/pritunl/issues/80","id":60468398,"number":80,"title":"API+Auth","user":{"login":"xUmaRix","id":11404526,"avatar_url":"https://avatars.githubusercontent.com/u/11404526?v=3","gravatar_id":"","url":"https://api.github.com/users/xUmaRix","html_url":"https://github.com/xUmaRix","followers_url":"https://api.github.com/users/xUmaRix/followers","following_url":"https://api.github.com/users/xUmaRix/following{/other_user}","gists_url":"https://api.github.com/users/xUmaRix/gists{/gist_id}","starred_url":"https://api.github.com/users/xUmaRix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xUmaRix/subscriptions","organizations_url":"https://api.github.com/users/xUmaRix/orgs","repos_url":"https://api.github.com/users/xUmaRix/repos","events_url":"https://api.github.com/users/xUmaRix/events{/privacy}","received_events_url":"https://api.github.com/users/xUmaRix/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-10T08:57:30Z","updated_at":"2015-03-10T08:57:30Z","closed_at":null,"body":"I had 2 issues on pritunl\r\n\r\n1. When a user is disabled in pritunl it still can connect to the VPN.I assume that the disabled feature is to prevent disabled user from connecting to the VPN.Can anyone clarify on this.\r\n\r\n2. I tried to authenticate to pritunl using API Token and API secret but I always get error 401 UNAUTHORIZED.Below is the code I'm using\r\n\r\n<?php\r\n\r\n$BASE_URL   = \"https://localhost:9700\";\r\n$API_TOKEN  = \"89v5HwwCpCtVOgZgAsEplu8re7JNaxEu\";\r\n$API_SECRET = \"2L2fspVfCrj1q9lwczbF9EU1gEGowXCR\";\r\n\r\nfunction auth_request($method, $path, $data=\"\") {\r\n    global $BASE_URL, $API_TOKEN, $API_SECRET;\r\n\r\n    $auth_timestamp = strval(time());\r\n    $auth_nonce = uniqid();\r\n    $auth_array = array(\r\n        $API_TOKEN,\r\n        $auth_timestamp,\r\n        $auth_nonce,\r\n        strtoupper($method),\r\n    if ($data) {\r\n        array_push($auth_array, $data);\r\n    }\r\n\r\n    $auth_string = join(\"&\", $auth_array);\r\n    $auth_signature = base64_encode(hash_hmac(\r\n        \"sha256\", $auth_string, $API_SECRET, true));\r\n    $options = array(\r\n        \"http\" => array(\r\n            \"header\"  => array(\r\n                'Content-Type: application/json',\r\n                'Auth-Token: '.$API_TOKEN,\r\n                'Auth-Timestamp: '.$auth_timestamp,\r\n                'Auth-Nonce: '.$auth_nonce,\r\n                'Auth-Signature: '.$auth_signature\r\n            ),\r\n            \"method\"  => $method,\r\n            \"content\" => $data,\r\n        ),\r\n    );\r\n\r\n    $context = stream_context_create($options);\r\n    return file_get_contents($BASE_URL.$path, false, $context);\r\n}\r\n\r\nprintf(auth_request(\"GET\", \"/status\").\"\\n\");\r\n//printf(auth_request(\"PUT\", \"/organization/6d18ab1855804e5e86121e24cd3ec0e5\",\r\n//    json_encode(array(\r\n//        \"name\" => \"test\",\r\n//    ))\r\n//).\"\\n\");\r\n\r\n?>"}}