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