s4:dsdb: Add session info flag to indicate authentication with a device
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Wed, 27 Sep 2023 01:54:06 +0000 (14:54 +1300)
committerJoseph Sutton <jsutton@samba.org>
Sun, 1 Oct 2023 22:45:38 +0000 (22:45 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
auth/common_auth.h
source4/dsdb/samdb/samdb.c

index 24b7b14f51a0a0b44bf97bb521079acbfd1c292e..58fb2cd0b3d3888e94342fb73cb6cc28b4f908d9 100644 (file)
@@ -40,6 +40,7 @@ enum auth_password_state {
 #define AUTH_SESSION_INFO_SIMPLE_PRIVILEGES  0x04 /* Use a trivial map between users and privileges, rather than a DB */
 #define AUTH_SESSION_INFO_UNIX_TOKEN         0x08 /* The returned token must have the unix_token and unix_info elements provided */
 #define AUTH_SESSION_INFO_NTLM               0x10 /* The returned token must have authenticated-with-NTLM flag set */
+#define AUTH_SESSION_INFO_FORCE_COMPOUNDED_AUTHENTICATION  0x20 /* The user authenticated with a device. */
 
 struct auth_usersupplied_info
 {
index 33cad4b1746edd45619816f10c689c7c397d5d99..81576829a7506bac782a74c539dd536900073e0f 100644 (file)
@@ -178,7 +178,7 @@ NTSTATUS security_token_create(TALLOC_CTX *mem_ctx,
        enum claims_evaluation_control evaluate_claims;
        bool sids_are_valid = false;
        bool device_sids_are_valid = false;
-       bool authentication_was_compounded = false;
+       bool authentication_was_compounded = session_info_flags & AUTH_SESSION_INFO_FORCE_COMPOUNDED_AUTHENTICATION;
 
        /*
         * Some special-case callers can't supply the lp_ctx, but do