Two Passwords (Password and "PIN")
Two Apps on one Smartphone (boils down to one "possession")
SMS / text message
HOTP, TOTP (RFC 4226, 6238) - with a symmetric key
Smartcards, U2F, FIDO2
Passwords
Biometrics
determine the behaviour of the system. Possible Scopes:
This way you get better (automated) and more flexible workflows.
credetials need to be sent to privacyIDEA, how?
There is nothing but the API.
https://privacyidea.readthedocs.io/en/latest/modules/api.html
POST /validate/check HTTP/1.1
Accept: application/json
user=username
pass=pin123456
realm=mydomain
HTTP/1.1 200 OK
Content-Type: application/json
{
"detail": {
"message": "matching 1 tokens",
"serial": "HOTP0000AB00",
"type": "hotp"
},
"id": 1,
"jsonrpc": "2.0",
"result": {
"status": true,
"value": true
},
"version": "3.1.1"
}
headers = {'user-agent': 'PAM/2.15.0'}
response = requests.post(self.URL + endpoint,
data=data,
headers=headers,
verify=self.sslverify)
json_response = response.json
if callable(json_response):
syslog.syslog(syslog.LOG_DEBUG, "requests > 1.0")
json_response = json_response()
return json_response
305 sloc Python - but it has offline functionality
https://github.com/privacyidea/pam_python/
$body = sspmod_privacyidea_Auth_utils::curl($params,
null, $this->serverconfig,
"/validate/samlcheck", "POST");
try {
$result = $body->result;
$detailAttributes = $body->detail;
SimpleSAML_Logger::debug("privacyidea result:" . print_r($result, True));
$status = $result->status;
$value = $result->value->auth;
} catch (Exception $e) {
throw new SimpleSAML_Error_BadRequest("We were not able to read the response from the privacyidea server.");
}
800 sloc PHP - but it has a lot of glue, two modes and enrollment features.
https://github.com/privacyidea/simplesamlphp-module-privacyidea
JsonObject body = _endpoint.sendRequest(ENDPOINT_VALIDATE_CHECK, params, false, POST);
try {
JsonObject result = body.getJsonObject(JSON_KEY_RESULT);
return result.getBoolean(JSON_KEY_VALUE);
} catch (Exception e) {
_log.error("Verification was not successful: Invalid response from privacyIDEA");
}
646 sloc Java - but it has glue and enrollment features.
https://github.com/privacyidea/keycloak-provider
if not result.get("value"):
syslog.syslog(syslog.LOG_INFO, "Failed authentication")
print("ERROR ERR_AUTH")
sys.exit(0)
else:
# successful authentication
syslog.syslog(syslog.LOG_INFO, "Authentication successful")
user = detail.get("user")
syslog.syslog(syslog.LOG_INFO, "user received")
out = RESPONSE.format(role="USER",
mail=user.get("email"),
displayname=u"{0} {1}".format(user.get("givenname"),
user.get("surname")))
print(out.encode("utf8"))
sys.exit(0)
https://github.com/privacyidea/privacyidea-benno-mailarchive
/auth