]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/UserCredential.h
Move the definitions defined for User Manager protocol from UserCredential.h to UserM...
[mirror_edk2.git] / MdePkg / Include / Protocol / UserCredential.h
CommitLineData
2832b228 1/** @file\r
2 UEFI 2.2 User Credential Protocol definition.\r
3\r
4 Attached to a device handle, this protocol identifies a single means of identifying the user.\r
5\r
75dad611 6 Copyright (c) 2009 - 2010, Intel Corporation \r
2832b228 7 All rights reserved. This program and the accompanying materials \r
8 are licensed and made available under the terms and conditions of the BSD License \r
9 which accompanies this distribution. The full text of the license may be found at \r
10 http://opensource.org/licenses/bsd-license.php \r
11\r
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
14\r
15**/\r
16\r
17#ifndef __USER_CREDENTIAL_H__\r
18#define __USER_CREDENTIAL_H__\r
19\r
75dad611 20#include <Protocol/UserManager.h>\r
21\r
2832b228 22#define EFI_USER_CREDENTIAL_PROTOCOL_GUID \\r
23 { \\r
24 0x71ee5e94, 0x65b9, 0x45d5, { 0x82, 0x1a, 0x3a, 0x4d, 0x86, 0xcf, 0xe6, 0xbe } \\r
25 }\r
26\r
2832b228 27typedef struct _EFI_USER_CREDENTIAL_PROTOCOL EFI_USER_CREDENTIAL_PROTOCOL;\r
28\r
29/**\r
30 Enroll a user on a credential provider.\r
31\r
32 This function enrolls a user profile using this credential provider. If a user profile is successfully \r
33 enrolled, it calls the User Manager Protocol function Notify() to notify the user manager driver \r
34 that credential information has changed.\r
35\r
36 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
37 @param[in] User The user profile to enroll.\r
38 \r
39 @retval EFI_SUCCESS User profile was successfully enrolled.\r
40 @retval EFI_ACCESS_DENIED Current user profile does not permit enrollment on the user profile \r
41 handle. Either the user profile cannot enroll on any user profile or \r
42 cannot enroll on a user profile other than the current user profile.\r
43 @retval EFI_UNSUPPORTED This credential provider does not support enrollment in the pre-OS.\r
44 @retval EFI_DEVICE_ERROR The new credential could not be created because of a device error.\r
45 @retval EFI_INVALID_PARAMETER User does not refer to a valid user profile handle.\r
46**/\r
47typedef\r
48EFI_STATUS\r
49(EFIAPI *EFI_CREDENTIAL_ENROLL)(\r
50 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
51 IN EFI_USER_PROFILE_HANDLE User\r
52 );\r
53\r
54/**\r
55 Returns the user interface information used during user identification.\r
56\r
57 This function returns information about the form used when interacting with the user during user \r
58 identification. The form is the first enabled form in the form-set class \r
59 EFI_HII_USER_CREDENTIAL_FORMSET_GUID installed on the HII handle HiiHandle. If \r
60 the user credential provider does not require a form to identify the user, then this function should \r
61 return EFI_NOT_FOUND.\r
62\r
63 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
64 @param[out] Hii On return, holds the HII database handle.\r
65 @param[out] FormSetId On return, holds the identifier of the form set which contains\r
66 the form used during user identification.\r
67 @param[out] FormId On return, holds the identifier of the form used during user identification.\r
68 \r
69 @retval EFI_SUCCESS Form returned successfully.\r
70 @retval EFI_NOT_FOUND Form not returned.\r
71**/\r
72typedef\r
73EFI_STATUS\r
74(EFIAPI *EFI_CREDENTIAL_FORM)(\r
75 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
76 OUT EFI_HII_HANDLE *Hii,\r
77 OUT EFI_GUID *FormSetId,\r
78 OUT EFI_FORM_ID *FormId\r
79 );\r
80\r
81/**\r
82 Returns bitmap used to describe the credential provider type.\r
83\r
84 This optional function returns a bitmap which is less than or equal to the number of pixels specified \r
85 by Width and Height. If no such bitmap exists, then EFI_NOT_FOUND is returned. \r
86\r
87 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
88 @param[in,out] Width On entry, points to the desired bitmap width. If NULL then no bitmap information will \r
89 be returned. On exit, points to the width of the bitmap returned.\r
90 @param[in,out] Height On entry, points to the desired bitmap height. If NULL then no bitmap information will \r
91 be returned. On exit, points to the height of the bitmap returned\r
92 @param[out] Hii On return, holds the HII database handle. \r
93 @param[out] Image On return, holds the HII image identifier. \r
94 \r
95 @retval EFI_SUCCESS Image identifier returned successfully.\r
96 @retval EFI_NOT_FOUND Image identifier not returned.\r
97**/\r
98typedef\r
99EFI_STATUS\r
100(EFIAPI *EFI_CREDENTIAL_TILE)(\r
101 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
102 IN OUT UINTN *Width,\r
103 IN OUT UINTN *Height,\r
104 OUT EFI_HII_HANDLE *Hii,\r
105 OUT EFI_IMAGE_ID *Image\r
106 );\r
107\r
108/**\r
109 Returns string used to describe the credential provider type.\r
110\r
111 This function returns a string which describes the credential provider. If no such string exists, then \r
112 EFI_NOT_FOUND is returned. \r
113\r
114 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
115 @param[out] Hii On return, holds the HII database handle.\r
116 @param[out] String On return, holds the HII string identifier.\r
117 \r
118 @retval EFI_SUCCESS String identifier returned successfully.\r
119 @retval EFI_NOT_FOUND String identifier not returned.\r
120**/\r
121typedef\r
122EFI_STATUS\r
123(EFIAPI *EFI_CREDENTIAL_TITLE)(\r
124 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
125 OUT EFI_HII_HANDLE *Hii,\r
126 OUT EFI_STRING_ID *String\r
127 );\r
128\r
129/**\r
130 Return the user identifier associated with the currently authenticated user.\r
131\r
132 This function returns the user identifier of the user authenticated by this credential provider. This \r
133 function is called after the credential-related information has been submitted on a form OR after a \r
134 call to Default() has returned that this credential is ready to log on.\r
135\r
136 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
137 @param[in] User The user profile handle of the user profile currently being considered by the user \r
138 identity manager. If NULL, then no user profile is currently under consideration.\r
139 @param[out] Identifier On return, points to the user identifier. \r
140 \r
141 @retval EFI_SUCCESS User identifier returned successfully.\r
142 @retval EFI_NOT_READY No user identifier can be returned.\r
143 @retval EFI_ACCESS_DENIED The user has been locked out of this user credential.\r
144**/\r
145typedef\r
146EFI_STATUS\r
147(EFIAPI *EFI_CREDENTIAL_USER)(\r
148 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
149 IN EFI_USER_PROFILE_HANDLE User,\r
150 OUT EFI_USER_INFO_IDENTIFIER *Identifier\r
151 );\r
152\r
153/**\r
154 Indicate that user interface interaction has begun for the specified credential.\r
155\r
156 This function is called when a credential provider is selected by the user. If AutoLogon returns \r
157 FALSE, then the user interface will be constructed by the User Identity Manager. \r
158\r
159 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
160 @param[out] AutoLogon On return, points to the credential provider's capabilities after the credential provider \r
161 has been selected by the user. \r
162 \r
163 @retval EFI_SUCCESS Credential provider successfully selected.\r
164**/\r
165typedef\r
166EFI_STATUS\r
167(EFIAPI *EFI_CREDENTIAL_SELECT)(\r
168 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
169 OUT EFI_CREDENTIAL_LOGON_FLAGS *AutoLogon\r
170 ); \r
171\r
172/**\r
173 Indicate that user interface interaction has ended for the specified credential.\r
174\r
175 This function is called when a credential provider is deselected by the user.\r
176\r
177 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
178 \r
179 @retval EFI_SUCCESS Credential provider successfully deselected.\r
180**/\r
181typedef\r
182EFI_STATUS\r
183(EFIAPI *EFI_CREDENTIAL_DESELECT)(\r
184 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This\r
185 );\r
186\r
187/**\r
188 Return the default logon behavior for this user credential.\r
189\r
190 This function reports the default login behavior regarding this credential provider. \r
191\r
192 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
193 @param[out] AutoLogon On return, holds whether the credential provider should be used by default to \r
194 automatically log on the user. \r
195 \r
196 @retval EFI_SUCCESS Default information successfully returned.\r
197**/\r
198typedef \r
199EFI_STATUS\r
200(EFIAPI *EFI_CREDENTIAL_DEFAULT)(\r
201 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
202 OUT EFI_CREDENTIAL_LOGON_FLAGS *AutoLogon\r
203 );\r
204\r
205/**\r
206 Return information attached to the credential provider.\r
207\r
208 This function returns user information. \r
209\r
210 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
211 @param[in] UserInfo Handle of the user information data record. \r
212 @param[out] Info On entry, points to a buffer of at least *InfoSize bytes. On exit, holds the user \r
213 information. If the buffer is too small to hold the information, then \r
214 EFI_BUFFER_TOO_SMALL is returned and InfoSize is updated to contain the \r
215 number of bytes actually required.\r
216 @param[in,out] InfoSize On entry, points to the size of Info. On return, points to the size of the user \r
217 information. \r
218 \r
219 @retval EFI_SUCCESS Information returned successfully.\r
220 @retval EFI_ACCESS_DENIED The information about the specified user cannot be accessed by the \r
221 current user.\r
222 @retval EFI_BUFFER_TOO_SMALL The size specified by InfoSize is too small to hold all of the user \r
223 information. The size required is returned in *InfoSize.\r
224**/\r
225typedef\r
226EFI_STATUS\r
227(EFIAPI *EFI_CREDENTIAL_GET_INFO)(\r
228 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
229 IN EFI_USER_INFO_HANDLE UserInfo,\r
230 OUT EFI_USER_INFO *Info,\r
231 IN OUT UINTN *InfoSize\r
232 );\r
233\r
234/**\r
235 Enumerate all of the enrolled users on the platform.\r
236\r
237 This function returns the next user information record. To retrieve the first user information record \r
238 handle, point UserInfo at a NULL. Each subsequent call will retrieve another user information \r
239 record handle until there are no more, at which point UserInfo will point to NULL. \r
240\r
241 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
242 @param[in,out] UserInfo On entry, points to the previous user information handle or NULL to start \r
243 enumeration. On exit, points to the next user information handle or NULL if there is \r
244 no more user information.\r
245 \r
246 @retval EFI_SUCCESS User information returned.\r
247 @retval EFI_NOT_FOUND No more user information found.\r
248**/\r
249typedef\r
250EFI_STATUS\r
251(EFIAPI *EFI_CREDENTIAL_GET_NEXT_INFO)(\r
252 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
253 IN OUT EFI_USER_INFO_HANDLE *UserInfo\r
254 );\r
255\r
256///\r
257/// This protocol provides support for a single class of credentials\r
258///\r
259struct _EFI_USER_CREDENTIAL_PROTOCOL {\r
260 EFI_GUID Identifier; ///< Uniquely identifies this credential provider.\r
261 EFI_GUID Type; ///< Identifies this class of User Credential Provider.\r
262 EFI_CREDENTIAL_ENROLL Enroll;\r
263 EFI_CREDENTIAL_FORM Form;\r
264 EFI_CREDENTIAL_TILE Tile;\r
265 EFI_CREDENTIAL_TITLE Title;\r
266 EFI_CREDENTIAL_USER User;\r
267 EFI_CREDENTIAL_SELECT Select; \r
268 EFI_CREDENTIAL_DESELECT Deselect;\r
269 EFI_CREDENTIAL_DEFAULT Default;\r
270 EFI_CREDENTIAL_GET_INFO GetInfo;\r
271 EFI_CREDENTIAL_GET_NEXT_INFO GetNextInfo;\r
272 EFI_CREDENTIAL_CAPABILITIES Capabilities;\r
273};\r
274\r
275extern EFI_GUID gEfiUserCredentialProtocolGuid;\r
276\r
277#endif\r