Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: mhttpauthenticationcallback.h

Class MHTTPAuthenticationCallback

class MHTTPAuthenticationCallback;

Description

The mixin that needs to be implemented if authentication is to be supported. This supplies the username and password when they are needed for authentication. To use, subclass off this class and implement GetCredentialsL. To install the class into a session, call InstallAuthenticationL.

Members

Defined in MHTTPAuthenticationCallback:
GetCredentialsL(), InstallAuthenticationL()


Member functions


GetCredentialsL()

virtual TBool GetCredentialsL(const TUriC8 &aURI, RString aRealm, RStringF aAuthenticationType, RString &aUsername, RString &aPassword)=0;

Description

Gets some credentials. Note that the first 3 parameters are informational and many clients may not have a use for them. Clients may want to display some or all of these parameters to the user, so that the user knows who they are giving their credentials to, and how securely they will be transmitted.

Parameters

const TUriC8 &aURI

The URI being requested

RString aRealm

The realm being requested

RStringF aAuthenticationType

The type of authentication (basic or digest)

RString &aUsername

The username is returned in this parameter. The caller will close the returned string.

RString &aPassword

The password is returned in this parameter The caller will close the returned string.

Return value

TBool

True if credentials have been obtained.

Leave codes

Anything.

If this function leaves the transaction will be failed.


InstallAuthenticationL()

inline void InstallAuthenticationL(RHTTPSession aSession);

Pre-Condition

The session is opened, but no transactions have been created on it

Description

Installs the callback into the session. Typicaly called from the implementation class's ConstructL().

Post-Condition

The session supports authentication, and uses this API to get its credentials.

Parameters

RHTTPSession aSession

the session to install the filter into.

Leave codes

KErrNoMemory

There was not enough memory.