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