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@2
|
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
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@2
|
6 |
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.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 |
|
williamr@2
|
18 |
/**
|
williamr@2
|
19 |
@file MHTTPAuthenticationCallback.h
|
williamr@2
|
20 |
@warning : This file contains Rose Model ID comments - please do not delete
|
williamr@2
|
21 |
*/
|
williamr@2
|
22 |
|
williamr@2
|
23 |
#ifndef __MHTTPAUTHENTICATIONCALLBACK_H__
|
williamr@2
|
24 |
#define __MHTTPAUTHENTICATIONCALLBACK_H__
|
williamr@2
|
25 |
|
williamr@2
|
26 |
// System includes
|
williamr@2
|
27 |
#include <uri8.h>
|
williamr@2
|
28 |
#include <stringpool.h>
|
williamr@2
|
29 |
#include <http/rhttpsession.h>
|
williamr@2
|
30 |
#include <http/cauthenticationfilterinterface.h>
|
williamr@2
|
31 |
|
williamr@2
|
32 |
|
williamr@2
|
33 |
//##ModelId=3B1E52A50151
|
williamr@2
|
34 |
class MHTTPAuthenticationCallback
|
williamr@2
|
35 |
/**
|
williamr@2
|
36 |
The mixin that needs to be implemented if authentication is to be
|
williamr@2
|
37 |
supported. This supplies the username and password when they are
|
williamr@2
|
38 |
needed for authentication.
|
williamr@2
|
39 |
To use, subclass off this class and implement GetCredentialsL. To install
|
williamr@2
|
40 |
the class into a session, call InstallAuthenticationL.
|
williamr@2
|
41 |
@publishedAll
|
williamr@2
|
42 |
@released
|
williamr@2
|
43 |
*/
|
williamr@2
|
44 |
{
|
williamr@2
|
45 |
public:
|
williamr@2
|
46 |
/** Gets some credentials. Note that the first 3 parameters are
|
williamr@2
|
47 |
informational and many clients may not have a use for
|
williamr@2
|
48 |
them. Clients may want to display some or all of these
|
williamr@2
|
49 |
parameters to the user, so that the user knows who they are
|
williamr@2
|
50 |
giving their credentials to, and how securely they will be
|
williamr@2
|
51 |
transmitted.
|
williamr@2
|
52 |
@param aURI The URI being requested
|
williamr@2
|
53 |
@param aRealm The realm being requested
|
williamr@2
|
54 |
@param aAuthenticationType The type of authentication (basic or digest)
|
williamr@2
|
55 |
@param aUsername The username is returned in this parameter.
|
williamr@2
|
56 |
The caller will close the returned string.
|
williamr@2
|
57 |
@param aPassword The password is returned in this parameter
|
williamr@2
|
58 |
The caller will close the returned string.
|
williamr@2
|
59 |
@return True if credentials have been obtained.
|
williamr@2
|
60 |
@leave Anything. If this function leaves the transaction will be
|
williamr@2
|
61 |
failed.
|
williamr@2
|
62 |
*/
|
williamr@2
|
63 |
//##ModelId=3B1E52A5015D
|
williamr@2
|
64 |
virtual TBool GetCredentialsL(const TUriC8& aURI, RString aRealm,
|
williamr@2
|
65 |
RStringF aAuthenticationType,
|
williamr@2
|
66 |
RString& aUsername,
|
williamr@2
|
67 |
RString& aPassword) = 0;
|
williamr@2
|
68 |
|
williamr@2
|
69 |
/** Installs the callback into the session.
|
williamr@2
|
70 |
Typicaly called from the implementation class's ConstructL().
|
williamr@2
|
71 |
@pre The session is opened, but no transactions have been created on it
|
williamr@2
|
72 |
@post The session supports authentication, and uses this API to
|
williamr@2
|
73 |
get its credentials.
|
williamr@2
|
74 |
@param aSession the session to install the filter into.
|
williamr@2
|
75 |
@leave KErrNoMemory There was not enough memory.
|
williamr@2
|
76 |
*/
|
williamr@2
|
77 |
//##ModelId=3B1E52A5015B
|
williamr@2
|
78 |
inline void InstallAuthenticationL(RHTTPSession aSession);
|
williamr@2
|
79 |
};
|
williamr@2
|
80 |
|
williamr@2
|
81 |
inline void MHTTPAuthenticationCallback::InstallAuthenticationL(RHTTPSession aSession)
|
williamr@2
|
82 |
{
|
williamr@2
|
83 |
CAuthenticationFilterInterface::InstallFilterL(aSession, this);
|
williamr@2
|
84 |
}
|
williamr@2
|
85 |
|
williamr@2
|
86 |
|
williamr@2
|
87 |
#endif // __MHTTPAUTHENTICATIONCALLBACK_H__
|