1 /****************************************************************************
3 * $Id: rmaauth.h 7 2003-05-30 02:18:02Z gabest $
5 * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved.
7 * http://www.real.com/devzone
9 * This program contains proprietary
10 * information of Progressive Networks, Inc, and is licensed
11 * subject to restrictions on use and distribution.
13 * Authentication and password interfaces.
21 * Forward declarations of some interfaces defined or used here-in.
23 typedef _INTERFACE IRMAAuthenticator IRMAAuthenticator
;
24 typedef _INTERFACE IRMAAuthenticatorResponse IRMAAuthenticatorResponse
;
25 typedef _INTERFACE IRMAAuthenticatorRequest IRMAAuthenticatorRequest
;
26 typedef _INTERFACE IRMAPassword IRMAPassword
;
27 typedef _INTERFACE IRMAAuthenticationManagerResponse IRMAAuthenticationManagerResponse
;
28 typedef _INTERFACE IRMAValues IRMAValues
;
29 typedef _INTERFACE IRMABuffer IRMABuffer
;
31 /****************************************************************************
39 * Provide a means of authenticating users.
41 * IID_IRMAAuthenticator:
43 * {00001800-0901-11d1-8B06-00A024406D59}
47 DEFINE_GUID(IID_IRMAAuthenticator
, 0x00001800, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
48 0xa0, 0x24, 0x40, 0x6d, 0x59);
50 #define CLSID_IRMAAuthenticator IID_IRMAAuthenticator
53 #define INTERFACE IRMAAuthenticator
55 DECLARE_INTERFACE_(IRMAAuthenticator
, IUnknown
)
57 STDMETHOD(QueryInterface
) (THIS_
61 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
63 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
66 * InitAuthenticator is called by the creator of the Authenticator
67 * object in order to pass it an IRMAAuthenticatorRequest object,
68 * usually implemented by the creator itself.
70 STDMETHOD(InitAuthenticator
) (THIS_
71 IRMAAuthenticatorRequest
* pRequest
) PURE
;
73 * Authenticate is called by a file object (and others??)
74 * when it wants to ask the creator, presumably an FS Manager,
75 * for authorization to open it's file.
77 * Authenticate will call IRMAAuthenticateResponse::AuthenticateDone
78 * when done with PNR_OK or an error.
80 * File objects will presumably perform the Authenticate response as
81 * part of their Init() call, and not call InitDone until they receive
82 * a response one way or the other.
84 STDMETHOD(Authenticate
) (THIS_
86 IRMAAuthenticatorResponse
* pResponse
) PURE
;
88 /* GenerateAuthRequest is called by the creator of this object
89 * when they want to send an authentication request to someone.
91 STDMETHOD(GenerateAuthRequest
) (THIS_
93 REF(IRMAValues
*) pValues
) PURE
;
95 * AuthValuesReady is called by IRMAAuthenticatorRequest when it
96 * is ready to respond to a GetAuthValues request.
98 STDMETHOD(AuthValuesReady
) (THIS_
100 IRMAValues
* pValues
) PURE
;
104 /****************************************************************************
108 * IRMAAuthenticatorResponse
112 * Response object for the Authenticator class.
114 * IID_IRMAAuthenticatorResponse:
116 * {00001801-0901-11d1-8B06-00A024406D59}
120 DEFINE_GUID(IID_IRMAAuthenticatorResponse
, 0x00001801, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
121 0xa0, 0x24, 0x40, 0x6d, 0x59);
124 #define INTERFACE IRMAAuthenticatorResponse
126 DECLARE_INTERFACE_(IRMAAuthenticatorResponse
, IUnknown
)
128 STDMETHOD(QueryInterface
) (THIS_
132 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
134 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
136 /* AuthenticateDone is called by an IRMAAuthenticator when it has
137 * finished it's authorization steps. If the result is PNR_OK,
138 * then the values contain authorization information as generated by
141 STDMETHOD(AuthenticateDone
) (THIS_ PN_RESULT result
,
142 IRMAValues
* pAuthResponseValues
) PURE
;
146 /****************************************************************************
150 * IRMAAuthenticatorRequest
154 * Request object for the Authenticator class.
156 * IID_IRMAAuthenticatorRequest:
158 * {00001802-0901-11d1-8B06-00A024406D59}
162 DEFINE_GUID(IID_IRMAAuthenticatorRequest
, 0x00001802, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
163 0xa0, 0x24, 0x40, 0x6d, 0x59);
166 #define INTERFACE IRMAAuthenticatorRequest
168 DECLARE_INTERFACE_(IRMAAuthenticatorRequest
, IUnknown
)
170 STDMETHOD(QueryInterface
) (THIS_
174 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
176 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
178 /* GetAuthValues is called by the Authenticator object when it
179 * needs to know the authorization info for this transaction.
181 * This object should call AuthValuesReady when ready.
183 STDMETHOD(GetAuthValues
) (THIS_ IRMAValues
* pOrigValues
) PURE
;
187 /****************************************************************************
195 * Provides a general password facility for storing of passwords in
196 * an encrypted form and a facility for verifying passwords securely
201 * {00001700-0901-11d1-8B06-00A024406D59}
205 #define PN_AUTH_BASIC 1
206 #define PN_AUTH_DIGEST 2
207 #define PN_AUTH_RN5 3
208 #define PN_AUTH_NTLM 4
210 DEFINE_GUID(IID_IRMAPassword
, 0x00001700, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
211 0xa0, 0x24, 0x40, 0x6d, 0x59);
214 #define INTERFACE IRMAPassword
216 DECLARE_INTERFACE_(IRMAPassword
, IUnknown
)
221 STDMETHOD(QueryInterface
) (THIS_
225 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
227 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
230 * IRMAPassword methods
233 STDMETHOD(Crypt
) (THIS_ IRMAValues
* pAuthentication
) PURE
;
234 STDMETHOD(Verify
) (THIS_ IRMAValues
* pAuth1
, IRMAValues
* pAuth2
) PURE
;
236 STDMETHOD(AsString
) (THIS_ IRMAValues
* pAuth
, REF(IRMABuffer
*) pBuffer
) PURE
;
237 STDMETHOD(AsValues
) (THIS_
const char* str
, IRMAValues
* pValues
) PURE
;
240 * CreateBuffer is provided for the convenince of external users,
241 * who would otherwise have to get a context and common class factory
242 * just to create IRMABuffers. This method can be used instead, but
243 * is not advisable if other means are available.
245 STDMETHOD(CreateBuffer
) (THIS_
REF(IRMABuffer
*) pBuffer
) PURE
;
248 * Ditto for CreateValues
250 STDMETHOD(CreateValues
) (THIS_
REF(IRMAValues
*) pValues
) PURE
;
254 /****************************************************************************
258 * IRMAAuthenticationManager
262 * Provide a means of authenticating users.
264 * IID_IRMAAuthenticator:
266 * {00001a00-0901-11d1-8B06-00A024406D59}
270 DEFINE_GUID(IID_IRMAAuthenticationManager
, 0x00001a00, 0x901, 0x11d1,
271 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
274 #define INTERFACE IRMAAuthenticationManager
276 DECLARE_INTERFACE_(IRMAAuthenticationManager
, IUnknown
)
278 STDMETHOD(QueryInterface
) (THIS_
281 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
282 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
284 /* HandleAuthenticationRequest is called when the core wants us to get
285 * a username and password.
287 STDMETHOD(HandleAuthenticationRequest
) (
288 THIS_ IRMAAuthenticationManagerResponse
* pResponse
) PURE
;
292 /****************************************************************************
296 * IRMAAuthenticationManagerResponse
300 * Response object for IRMAAuthenticationManager.
302 * IID_IRMAAuthenticator:
304 * {00001a01-0901-11d1-8B06-00A024406D59}
308 DEFINE_GUID(IID_IRMAAuthenticationManagerResponse
, 0x00001a01, 0x901, 0x11d1,
309 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
313 #define INTERFACE IRMAAuthenticationManagerResponse
315 DECLARE_INTERFACE_(IRMAAuthenticationManagerResponse
, IUnknown
)
317 STDMETHOD(QueryInterface
) (THIS_
320 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
321 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
323 /* HandleAuthenticationRequest is called when the core wants us to get
324 * a username and password.
326 STDMETHOD(AuthenticationRequestDone
) (THIS_
328 const char* pUserName
,
329 const char* pPassword
) PURE
;
336 STDAPI
CreatePassword(IUnknown
** /* OUT */ ppIUnknown
);
342 #endif /* _RMAAUTH_H_ */