auth: Common function for retrieving PAC_LOGIN_INFO from PAC
[Samba.git] / source4 / auth / session.h
blob97a8aba0f141c470f6239163e26be34e5b074d69
1 /*
2 Unix SMB/CIFS implementation.
3 Process and provide the logged on user's authorization token
4 Copyright (C) Andrew Bartlett 2001
5 Copyright (C) Stefan Metzmacher 2005
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef _SAMBA_AUTH_SESSION_H
22 #define _SAMBA_AUTH_SESSION_H
24 #include "librpc/gen_ndr/security.h"
25 #include "librpc/gen_ndr/netlogon.h"
26 #include "librpc/gen_ndr/auth.h"
28 struct tevent_context;
29 struct ldb_context;
30 struct ldb_dn;
31 /* Create a security token for a session SYSTEM (the most
32 * trusted/prvilaged account), including the local machine account as
33 * the off-host credentials */
34 struct auth_session_info *system_session(struct loadparm_context *lp_ctx) ;
36 NTSTATUS auth_anonymous_user_info_dc(TALLOC_CTX *mem_ctx,
37 const char *netbios_name,
38 struct auth_user_info_dc **interim_info);
39 NTSTATUS auth_generate_session_info(TALLOC_CTX *mem_ctx,
40 struct loadparm_context *lp_ctx, /* Optional, if you don't want privilages */
41 struct ldb_context *sam_ctx, /* Optional, if you don't want local groups */
42 struct auth_user_info_dc *interim_info,
43 uint32_t session_info_flags,
44 struct auth_session_info **session_info);
45 NTSTATUS auth_anonymous_session_info(TALLOC_CTX *parent_ctx,
46 struct loadparm_context *lp_ctx,
47 struct auth_session_info **session_info);
48 struct auth_session_info *auth_session_info_from_transport(TALLOC_CTX *mem_ctx,
49 struct auth_session_info_transport *session_info_transport,
50 struct loadparm_context *lp_ctx,
51 const char **reason);
52 NTSTATUS auth_session_info_transport_from_session(TALLOC_CTX *mem_ctx,
53 struct auth_session_info *session_info,
54 struct tevent_context *event_ctx,
55 struct loadparm_context *lp_ctx,
56 struct auth_session_info_transport **transport_out);
58 /* Produce a session_info for an arbitary DN or principal in the local
59 * DB, assuming the local DB holds all the groups
61 * Supply either a principal or a DN
63 NTSTATUS authsam_get_session_info_principal(TALLOC_CTX *mem_ctx,
64 struct loadparm_context *lp_ctx,
65 struct ldb_context *sam_ctx,
66 const char *principal,
67 struct ldb_dn *user_dn,
68 uint32_t session_info_flags,
69 struct auth_session_info **session_info);
71 struct auth_session_info *anonymous_session(TALLOC_CTX *mem_ctx,
72 struct loadparm_context *lp_ctx);
74 struct auth_session_info *admin_session(TALLOC_CTX *mem_ctx,
75 struct loadparm_context *lp_ctx,
76 struct dom_sid *domain_sid);
79 #endif /* _SAMBA_AUTH_SESSION_H */