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