1.1 --- a/epoc32/include/http/mhttpauthenticationcallback.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/http/mhttpauthenticationcallback.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,87 @@
1.4 -mhttpauthenticationcallback.h
1.5 +// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// 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
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +
1.20 +
1.21 +
1.22 +/**
1.23 + @file MHTTPAuthenticationCallback.h
1.24 + @warning : This file contains Rose Model ID comments - please do not delete
1.25 +*/
1.26 +
1.27 +#ifndef __MHTTPAUTHENTICATIONCALLBACK_H__
1.28 +#define __MHTTPAUTHENTICATIONCALLBACK_H__
1.29 +
1.30 +// System includes
1.31 +#include <uri8.h>
1.32 +#include <stringpool.h>
1.33 +#include <http/rhttpsession.h>
1.34 +#include <http/cauthenticationfilterinterface.h>
1.35 +
1.36 +
1.37 +//##ModelId=3B1E52A50151
1.38 +class MHTTPAuthenticationCallback
1.39 +/**
1.40 +The mixin that needs to be implemented if authentication is to be
1.41 +supported. This supplies the username and password when they are
1.42 +needed for authentication.
1.43 +To use, subclass off this class and implement GetCredentialsL. To install
1.44 +the class into a session, call InstallAuthenticationL.
1.45 +@publishedAll
1.46 +@released
1.47 +*/
1.48 + {
1.49 + public:
1.50 + /** Gets some credentials. Note that the first 3 parameters are
1.51 + informational and many clients may not have a use for
1.52 + them. Clients may want to display some or all of these
1.53 + parameters to the user, so that the user knows who they are
1.54 + giving their credentials to, and how securely they will be
1.55 + transmitted.
1.56 + @param aURI The URI being requested
1.57 + @param aRealm The realm being requested
1.58 + @param aAuthenticationType The type of authentication (basic or digest)
1.59 + @param aUsername The username is returned in this parameter.
1.60 + The caller will close the returned string.
1.61 + @param aPassword The password is returned in this parameter
1.62 + The caller will close the returned string.
1.63 + @return True if credentials have been obtained.
1.64 + @leave Anything. If this function leaves the transaction will be
1.65 + failed.
1.66 + */
1.67 + //##ModelId=3B1E52A5015D
1.68 + virtual TBool GetCredentialsL(const TUriC8& aURI, RString aRealm,
1.69 + RStringF aAuthenticationType,
1.70 + RString& aUsername,
1.71 + RString& aPassword) = 0;
1.72 +
1.73 + /** Installs the callback into the session.
1.74 + Typicaly called from the implementation class's ConstructL().
1.75 + @pre The session is opened, but no transactions have been created on it
1.76 + @post The session supports authentication, and uses this API to
1.77 + get its credentials.
1.78 + @param aSession the session to install the filter into.
1.79 + @leave KErrNoMemory There was not enough memory.
1.80 + */
1.81 + //##ModelId=3B1E52A5015B
1.82 + inline void InstallAuthenticationL(RHTTPSession aSession);
1.83 + };
1.84 +
1.85 +inline void MHTTPAuthenticationCallback::InstallAuthenticationL(RHTTPSession aSession)
1.86 + {
1.87 + CAuthenticationFilterInterface::InstallFilterL(aSession, this);
1.88 + }
1.89 +
1.90 +
1.91 +#endif // __MHTTPAUTHENTICATIONCALLBACK_H__