williamr@2: /* williamr@2: * Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: Callback interface through which (web service consumer/management) williamr@2: * applications can provide userinfo / account (username & password) williamr@2: * to WS-stack. This information can be used in actual authentication williamr@2: * with (remote) web service (Liberty Authentication Service or williamr@2: * WS-* STS), or locally (in device) to allow secure access to private williamr@2: * information (like credentials to the service, etc). williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: #ifndef M_SEN_AUTHENTICATION_PROVIDER_H williamr@2: #define M_SEN_AUTHENTICATION_PROVIDER_H williamr@2: williamr@2: // INCLUDES williamr@2: #include williamr@2: williamr@2: // FORWARD DECLARATIONS williamr@2: class CSenIdentityProvider; williamr@2: williamr@2: /** williamr@2: * Interface description: williamr@2: * williamr@2: * The applications can register this callback interface, through which they will receive williamr@2: * userinfo callbacks (when data like username and password is needed). williamr@2: * williamr@2: * Both Service Connection and Service Manager APIs utilize this interface. williamr@2: * williamr@2: * In practice, service consumer applications often integrate these callbacks to their UI williamr@2: * events, allowing them a control point end-user (login) prompts. williamr@2: * williamr@2: * Furthermore, (remote) service management applications can provide identity (user account) williamr@2: * spesific "secret", in order to manipulate associated credentials stored in Web Services williamr@2: * -stack database(s). williamr@2: */ williamr@2: class MSenAuthenticationProvider williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * If (consumer) application needs to access protected information or service williamr@2: * (behind some identity / account / sing-in process), it may choose to override williamr@2: * this method. Returned object represents XML containing all required information williamr@2: * that is required to securely authenticate the identity in question. williamr@2: * In case that only username & password -pair is needed, application may williamr@2: * alternatively implement UsernameL() and PasswordL() callbacks. williamr@2: * @returs the identity provider description that contains "credentials", like williamr@2: * like username and password of some identity (user's account), or other (binary) williamr@2: * secret, like fingerprint. williamr@2: williamr@2: */ williamr@2: virtual const CSenIdentityProvider* IdentityProviderL() { return NULL; } williamr@2: williamr@2: /** williamr@2: * Callback type getter for username. williamr@2: * through this method an application may choose to provide the username of williamr@2: * an account it wishes to use. williamr@2: * In cases where the username (login ID) is in simple text format (descriptor), williamr@2: * this may be the most convenient method to be overridden. Alternatively, williamr@2: * in complex cases, applications may choose to provide identity provider (IDP) williamr@2: * description, a piece of XML through IdentityProviderL() callback; that williamr@2: * XML could contain extended amount of (binary) information, like fingerprint. williamr@2: * Consumer application is supposed to decide, whether or not to show a GUI williamr@2: * dialog when this callback is issued: in many cases, that is a common williamr@2: * approach to prompt userinfo directly from end-user (unless data is cached williamr@2: * elsewhere). williamr@2: * @return Password as string (UTF-8 descriptor) williamr@2: */ williamr@2: virtual const TPtrC8 UsernameL() { return TPtrC8(KNullDesC8); } williamr@2: williamr@2: /** williamr@2: * Callback type getter for password. williamr@2: * Application may choose to provide the passport of an account through this williamr@2: * method. In cases where the "secret" is in simple text format (descriptor), williamr@2: * this may be the most convenient method to be overridden. Alternatively, williamr@2: * in complex cases, applications may choose to provide identity provider (IDP) williamr@2: * description, a piece of XML through IdentityProviderL() callback; that williamr@2: * XML could contain extended amount of (binary) information, like fingerprint. williamr@2: * Consumer application is supposed to decide, whether or not to show a GUI williamr@2: * dialog when this callback is issued: in many cases, that is a common williamr@2: * approach to prompt userinfo directly from end-user (unless data is cached williamr@2: * elsewhere). williamr@2: * @return Password as string (UTF-8 descriptor) williamr@2: */ williamr@2: virtual const TPtrC8 PasswordL() { return TPtrC8(KNullDesC8); } williamr@2: williamr@2: /** williamr@2: * This method obtains the callback interface matching the specified uid. williamr@2: * @param aUid the uid identifying the required interface. williamr@2: * @return NULL if no interface matching the uid is found. williamr@2: * Otherwise, attempt to dynamically cast this pointer williamr@2: * to that interface will be made. williamr@2: */ williamr@2: inline virtual TAny* ExtendedInterface(const TInt32 /* aUid */) { return NULL; } williamr@2: }; williamr@2: williamr@2: #endif // M_SEN_PROPERTIES_H williamr@2: williamr@2: // End of File williamr@2: