epoc32/include/http/mhttpauthenticationcallback.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 
    17 
    18 /**
    19  @file MHTTPAuthenticationCallback.h
    20  @warning : This file contains Rose Model ID comments - please do not delete
    21 */
    22 
    23 #ifndef	__MHTTPAUTHENTICATIONCALLBACK_H__
    24 #define	__MHTTPAUTHENTICATIONCALLBACK_H__ 
    25 
    26 // System includes
    27 #include <uri8.h>
    28 #include <stringpool.h>
    29 #include <http/rhttpsession.h>
    30 #include <http/cauthenticationfilterinterface.h>
    31 
    32 
    33 //##ModelId=3B1E52A50151
    34 class MHTTPAuthenticationCallback
    35 /** 
    36 The mixin that needs to be implemented if authentication is to be
    37 supported. This supplies the username and password when they are
    38 needed for authentication.
    39 To use, subclass off this class and implement GetCredentialsL. To install
    40 the class into a session, call InstallAuthenticationL.
    41 @publishedAll
    42 @released
    43 */
    44 	{
    45  public:
    46 	/** Gets some credentials. Note that the first 3 parameters are
    47 		informational and many clients may not have a use for
    48 		them. Clients may want to display some or all of these
    49 		parameters to the user, so that the user knows who they are
    50 		giving their credentials to, and how securely they will be
    51 		transmitted.
    52 		@param aURI The URI being requested
    53 		@param aRealm The realm being requested
    54 		@param aAuthenticationType The type of authentication (basic or digest)
    55 		@param aUsername The username is returned in this parameter. 
    56 		The caller will close the returned string.
    57 		@param aPassword The password is returned in this parameter
    58 		The caller will close the returned string.
    59 		@return True if credentials have been obtained. 
    60 		@leave Anything. If this function leaves the transaction will be 
    61 		failed. 
    62 	*/
    63 	//##ModelId=3B1E52A5015D
    64 	virtual TBool GetCredentialsL(const TUriC8& aURI, RString aRealm, 
    65 								  RStringF aAuthenticationType,
    66 								  RString& aUsername, 
    67 								  RString& aPassword) = 0;
    68 
    69 	/** Installs the callback into the session.
    70 		Typicaly called from the implementation class's ConstructL().
    71 		@pre The session is opened, but no transactions have been created on it
    72 		@post The session supports authentication, and uses this API to
    73 		get its credentials.
    74 		@param aSession the session to install the filter into.
    75 		@leave KErrNoMemory There was not enough memory.
    76 	 */
    77 	//##ModelId=3B1E52A5015B
    78 	inline void InstallAuthenticationL(RHTTPSession aSession);
    79 	};
    80 
    81 inline void MHTTPAuthenticationCallback::InstallAuthenticationL(RHTTPSession aSession)
    82 	{
    83 	CAuthenticationFilterInterface::InstallFilterL(aSession, this);
    84 	}
    85 
    86 
    87 #endif //	__MHTTPAUTHENTICATIONCALLBACK_H__