mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-18 18:44:44 +00:00
authentication: extend opnsense-auth to respond with json encoded data when the authenticator received additional properties (such as framed ip addresses, groups, etc). needed for https://github.com/opnsense/core/issues/3266 should be a non-breaking change, since current authentication sequences only use the return code.
This commit is contained in:
parent
f098b3a9ba
commit
875a1e2d4a
@ -63,6 +63,11 @@ if (!empty($auth_data['user']) && isset($auth_data['password'])) {
|
||||
$authFactory = new \OPNsense\Auth\AuthenticationFactory();
|
||||
$is_authenticated = $authFactory->authenticate($auth_data['service'], $auth_data['user'], $auth_data['password']);
|
||||
if ($is_authenticated) {
|
||||
$authProps = $authFactory->getLastAuthProperties();
|
||||
if (!empty($authProps)) {
|
||||
// dump authentication response data to stdout
|
||||
echo json_encode($authProps, JSON_INVALID_UTF8_IGNORE) ."\n";
|
||||
}
|
||||
$exit_status = 0;
|
||||
} else {
|
||||
if (getUserEntry($auth_data['user']) === false) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user