1 /****************************************************************************
3 * $Id: rmaauthn.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.
14 * RealMedia Architecture Interface.
22 * Forward declarations of some interfaces defined or used here-in.
24 typedef _INTERFACE IUnknown IUnknown
;
25 typedef _INTERFACE IRMACredRequest IRMACredRequest
;
26 typedef _INTERFACE IRMACredRequestResponse IRMACredRequestResponse
;
27 typedef _INTERFACE IRMAClientAuthConversation IRMAClientAuthConversation
;
28 typedef _INTERFACE IRMAClientAuthResponse IRMAClientAuthResponse
;
29 typedef _INTERFACE IRMAServerAuthConversation IRMAServerAuthConversation
;
30 typedef _INTERFACE IRMAServerAuthResponse IRMAServerAuthResponse
;
31 typedef _INTERFACE IRMAUserContext IRMAUserContext
;
32 typedef _INTERFACE IRMAUserProperties IRMAUserProperties
;
33 typedef _INTERFACE IRMAUserImpersonation IRMAUserImpersonation
;
34 typedef _INTERFACE IRMAChallenge IRMAChallenge
;
35 typedef _INTERFACE IRMAChallengeResponse IRMAChallengeResponse
;
36 typedef _INTERFACE IRMARequest IRMARequest
;
37 typedef _INTERFACE IRMABuffer IRMABuffer
;
38 typedef _INTERFACE IRMAValues IRMAValues
;
41 /****************************************************************************
49 * This is queried from the response interface passed into
50 * IRMAClientAuthConversation::MakeResponse. MakeResponse
51 * uses it to request the current user to enter their credentials.
55 * {00002801-0901-11d1-8B06-00A024406D59}
58 DEFINE_GUID(IID_IRMACredRequest
, 0x00002801, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
61 #define INTERFACE IRMACredRequest
63 DECLARE_INTERFACE_(IRMACredRequest
, IUnknown
)
68 STDMETHOD(QueryInterface
) (THIS_
72 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
74 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
76 /************************************************************************
78 * IRMACredRequest::GetCredentials
81 * Call this to request the credentials. Usually presents UI to
82 * the user asking for username and password.
84 * While ignored at this time, pValuesCredentialRequest should
85 * contain CString properties that describe the reason for the
86 * request. (like the URL, the Realm, the Auth protocol, and how
87 * secure it is, etc..) In the future this data will be displayed
91 STDMETHOD(GetCredentials
)
94 IRMACredRequestResponse
* pCredRequestResponseRequester
,
95 IRMAValues
* pValuesCredentialRequest
100 /****************************************************************************
104 * IRMACredRequestResponse
108 * This is implemented by a client authenticator in order to receive
109 * the credentials requested in IRMACredRequest::GetCredentials
111 * IRMACredRequestResponse:
113 * {00002800-0901-11d1-8B06-00A024406D59}
116 DEFINE_GUID(IID_IRMACredRequestResponse
, 0x00002800, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
119 #define INTERFACE IRMACredRequestResponse
121 DECLARE_INTERFACE_(IRMACredRequestResponse
, IUnknown
)
126 STDMETHOD(QueryInterface
) (THIS_
130 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
132 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
134 /************************************************************************
136 * IRMACredRequestResponse::CredentialsReady
139 * Reports the success or failure of
140 * IRMACredRequest::GetCredentials
142 * If successful pValuesCredentials contains the requested
143 * credentials. (usually CString:Username and CString:Password)
146 STDMETHOD(CredentialsReady
)
149 PN_RESULT ResultStatus
,
150 IRMAValues
* pValuesCredentials
155 /****************************************************************************
159 * IRMAClientAuthConversation
163 * This is implemented by a client authenticator in order to perform
164 * the client side of an authentication protocol.
166 * IRMAClientAuthConversation:
168 * {00002803-0901-11d1-8B06-00A024406D59}
171 DEFINE_GUID(IID_IRMAClientAuthConversation
, 0x00002803, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
174 * The IRMACommonClassFactory supports creating an instance
177 #define CLSID_CRMAClientAuthenticator IID_IRMAClientAuthConversation
180 #define INTERFACE IRMAClientAuthConversation
182 DECLARE_INTERFACE_(IRMAClientAuthConversation
, IUnknown
)
187 STDMETHOD(QueryInterface
) (THIS_
191 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
193 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
195 /************************************************************************
197 * IRMAClientAuthConversation::MakeResponse
200 * Call this when a challenge is received from the server.
202 * pRequestChallengeHeaders should contain the server challenge.
205 STDMETHOD(MakeResponse
)
208 IRMAClientAuthResponse
* pClientAuthResponseRequester
,
209 IRMARequest
* pRequestChallengeHeaders
212 /************************************************************************
214 * IRMAClientAuthConversation::IsDone
217 * Call this to determine whether the conversation is complete.
218 * (some protocols have more then one message exchange.)
221 STDMETHOD_(BOOL
,IsDone
)(THIS
) PURE
;
223 /************************************************************************
225 * IRMAClientAuthConversation::Authenticated
228 * Call this to signal the authenticator that the conversation
229 * just completed succeeded or failed.
232 STDMETHOD(Authenticated
)(THIS_ BOOL bAuthenticated
) PURE
;
235 /****************************************************************************
239 * IRMAClientAuthResponse
243 * This is implemented by the client core in order to receive the
244 * response generated by IRMAClientAuthConversation::MakeResponse
246 * IRMAClientAuthResponse:
248 * {00002802-0901-11d1-8B06-00A024406D59}
251 DEFINE_GUID(IID_IRMAClientAuthResponse
, 0x00002802, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
254 #define INTERFACE IRMAClientAuthResponse
256 DECLARE_INTERFACE_(IRMAClientAuthResponse
, IUnknown
)
261 STDMETHOD(QueryInterface
) (THIS_
265 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
267 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
269 /************************************************************************
271 * IRMAClientAuthResponse::ResponseReady
274 * Reports the success or failure of
275 * IRMAClientAuthConversation::MakeResponse
277 * pRequestResponseHeaders should be the same Request object
278 * that was passed into MakeResponse, it should contain
279 * CString values for each MimeHeader it wishes to send to
283 STDMETHOD(ResponseReady
)
286 PN_RESULT ResultStatus
,
287 IRMARequest
* pRequestResponseHeaders
293 /****************************************************************************
297 * IRMAServerAuthConversation
301 * This is implemented by a server authenticator in order to perform
302 * the server side of an authentication protocol.
304 * IRMAServerAuthConversation:
306 * {00002805-0901-11d1-8B06-00A024406D59}
309 DEFINE_GUID(IID_IRMAServerAuthConversation
, 0x00002805, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
312 * The IRMACommonClassFactory supports creating an instance
315 #define CLSID_CRMAServerAuthenticator IID_IRMAServerAuthResponse
318 #define INTERFACE IRMAServerAuthConversation
320 DECLARE_INTERFACE_(IRMAServerAuthConversation
, IUnknown
)
325 STDMETHOD(QueryInterface
) (THIS_
329 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
331 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
333 /************************************************************************
335 * IRMAServerAuthConversation::MakeChallenge
338 * Call this to create a challenge for a client. If the request
339 * passed in does not contain a respose from the client, then it
340 * will generate the initial challenge.
342 * pRequestResponseHeaders is the request for a secured URL. If
343 * this is the initial request for the URL it probably does not
344 * have any credentials from the client.
347 STDMETHOD(MakeChallenge
)
350 IRMAServerAuthResponse
* pServerAuthResponseRequester
,
351 IRMARequest
* pRequestResponseHeaders
354 /************************************************************************
356 * IRMAServerAuthConversation::IsAuthenticated
359 * Call this to determine whether the last response from the
360 * client completed the authentication successfully.
363 STDMETHOD_(BOOL
,IsAuthenticated
)(THIS
) PURE
;
365 /************************************************************************
367 * IRMAServerAuthConversation::GetUserContext
370 * Call this to retrieve the Context of the user that completed
371 * authentication successfully.
373 * If successful pUnknownUser is a valid context
376 STDMETHOD(GetUserContext
)(THIS_
REF(IUnknown
*) pUnknownUser
) PURE
;
380 /****************************************************************************
384 * IRMAServerAuthResponse
388 * This is implemented by various server plugins in order to receive the
389 * challenge generated by IRMAServerAuthConversation::MakeChallenge
391 * IRMAServerAuthResponse:
393 * {00002804-0901-11d1-8B06-00A024406D59}
396 DEFINE_GUID(IID_IRMAServerAuthResponse
, 0x00002804, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
399 #define INTERFACE IRMAServerAuthResponse
401 DECLARE_INTERFACE_(IRMAServerAuthResponse
, IUnknown
)
406 STDMETHOD(QueryInterface
) (THIS_
410 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
412 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
414 /************************************************************************
416 * IRMAServerAuthResponse::ChallengeReady
419 * Reports the success or failure of
420 * IRMAServerAuthConversation::MakeChallenge
422 * pRequestChallengeHeaders should be the same Request object
423 * that was passed into MakeChallenge, it should contain
424 * CString values for each MimeHeader it wishes to send to
428 STDMETHOD(ChallengeReady
)
431 PN_RESULT ResultStatus
,
432 IRMARequest
* pRequestChallengeHeaders
438 /****************************************************************************
446 * This is implemented by a user context in order to provide
447 * access to information about the currently authenticated user.
451 * {00002806-0901-11d1-8B06-00A024406D59}
454 DEFINE_GUID(IID_IRMAUserContext
, 0x00002806, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
457 #define INTERFACE IRMAUserContext
459 DECLARE_INTERFACE_(IRMAUserContext
, IUnknown
)
464 STDMETHOD(QueryInterface
) (THIS_
468 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
470 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
472 /************************************************************************
474 * IRMAUserContext::IsMemberOf
477 * Call this to determine whether the authenticated user
478 * is a member of the specified group.
481 STDMETHOD(IsMemberOf
)(THIS_ IRMABuffer
* pBufferGroupID
) PURE
;
485 /****************************************************************************
493 * This is implemented by a user context in order to provide
494 * access to properties of the currently authenticated user.
496 * IRMAUserProperties:
498 * {00002807-0901-11d1-8B06-00A024406D59}
501 DEFINE_GUID(IID_IRMAUserProperties
, 0x00002807, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
504 #define INTERFACE IRMAUserProperties
506 DECLARE_INTERFACE_(IRMAUserProperties
, IUnknown
)
511 STDMETHOD(QueryInterface
) (THIS_
515 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
517 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
520 /************************************************************************
522 * IRMAUserProperties::GetPrincipalID
525 * Call this to determine the principalID of the authenticated user.
528 STDMETHOD(GetPrincipalID
)(THIS_
REF(IRMABuffer
*) pBufferPrincipalID
) PURE
;
530 /************************************************************************
532 * IRMAUserProperties::GetAuthorityName
535 * Call this to determine the authority name that authorized the
536 * authenticated user. (realm or domain name)
539 STDMETHOD(GetAuthorityName
)(THIS_
REF(IRMABuffer
*) pBufferAuthorityName
) PURE
;
544 /****************************************************************************
548 * IRMAUserImpersonation
552 * This can be implemented by a user context in order to provide
553 * the ability to have the server impersonate the currently authenticated
556 * IRMAUserImpersonation:
558 * {00002808-0901-11d1-8B06-00A024406D59}
561 DEFINE_GUID(IID_IRMAUserImpersonation
, 0x00002808, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
564 #define INTERFACE IRMAUserImpersonation
566 DECLARE_INTERFACE_(IRMAUserImpersonation
, IUnknown
)
571 STDMETHOD(QueryInterface
) (THIS_
575 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
577 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
579 /************************************************************************
581 * IRMAUserImpersonation::Start
584 * Call this to impersonate the authenticated user.
587 STDMETHOD(Start
)(THIS
) PURE
;
589 /************************************************************************
591 * IRMAUserImpersonation::Stop
594 * Call this to stop impersonating the authenticated user.
597 STDMETHOD(Stop
)(THIS
) PURE
;
601 /****************************************************************************
609 * This is implemented by the server core in order to allow
610 * additional exchanges of information with the client without
611 * creating a new request. (It is stored in the IRMARequest object
612 * and can be retrieved by calling IRMARequestContext::GetRequester()
613 * if it is absent then the protocol that this request was made on
614 * does not support multi-message authentication (PNA doesn't) )
618 * {0000280A-0901-11d1-8B06-00A024406D59}
621 DEFINE_GUID(IID_IRMAChallenge
, 0x0000280A, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
624 #define INTERFACE IRMAChallenge
626 DECLARE_INTERFACE_(IRMAChallenge
, IUnknown
)
631 STDMETHOD(QueryInterface
) (THIS_
635 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
637 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
639 /************************************************************************
641 * IRMAChallenge::SendChallenge
644 * Call this to request additional information from the client.
646 * pRequestChallenge should be the same Request object
647 * that was passed into MakeChallenge, it should contain
648 * CString values for each MimeHeader it wishes to send to
652 STDMETHOD(SendChallenge
)
655 IRMAChallengeResponse
* pChallengeResponseSender
,
656 IRMARequest
* pRequestChallenge
661 /****************************************************************************
665 * IRMAChallengeResponse
669 * This is implemented by a server authenticator in order to
670 * receive the Response returned by the client in response to
671 * IRMAChallenge::SendChallenge.
673 * IRMAChallengeResponse:
675 * {00002809-0901-11d1-8B06-00A024406D59}
678 DEFINE_GUID(IID_IRMAChallengeResponse
, 0x00002809, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
681 #define INTERFACE IRMAChallengeResponse
683 DECLARE_INTERFACE_(IRMAChallengeResponse
, IUnknown
)
688 STDMETHOD(QueryInterface
) (THIS_
692 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
694 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
696 /************************************************************************
698 * IRMAChallengeResponse::ResponseReady
701 * Called this to return the additional information requested
702 * from IRMAChallenge::SendChallenge.
704 * pRequestResponse should be the same Request object
705 * that was passed into MakeChallenge and SendChallenge.
708 STDMETHOD(ResponseReady
)
711 IRMARequest
* pRequestResponse
716 #endif //!_RMAAUTHN_H_