webservices/wsoviplugin/src/wsovioauthclient.cpp
branchRCL_3
changeset 22 56092bff76ba
parent 20 32ab7ae9ec94
child 30 b72ea8487adb
equal deleted inserted replaced
20:32ab7ae9ec94 22:56092bff76ba
    38 #include "senwspattern.h"
    38 #include "senwspattern.h"
    39 #include "wsovicons.h"
    39 #include "wsovicons.h"
    40 #include "wsovitokencreationresponse.h"
    40 #include "wsovitokencreationresponse.h"
    41 #include "sencryptoutils.h"
    41 #include "sencryptoutils.h"
    42 #include "wsoviutils.h"
    42 #include "wsoviutils.h"
       
    43 #include <SenDateUtils.h>
    43 
    44 
    44 namespace 
    45 namespace 
    45     {
    46     {
    46     _LIT8(KRemoteConsumer,       "RemoteConsumer");
    47     _LIT8(KRemoteConsumer,       "RemoteConsumer");
    47     }
    48     }
   528 	        retVal = KErrNotFound;
   529 	        retVal = KErrNotFound;
   529 	        }
   530 	        }
   530 	    else
   531 	    else
   531 	        {
   532 	        {
   532 	        iWSOviServiceSession->SetTrustAnchorL(iIdentityProvider->ProviderID());
   533 	        iWSOviServiceSession->SetTrustAnchorL(iIdentityProvider->ProviderID());
   533 	            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviOAuthClient::ValidateL - set ctx basing on response");
   534 	        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviOAuthClient::ValidateL - set ctx basing on response");
       
   535 	        
       
   536 		    TPtrC8 validUntil = responseFragment->ValidUntil();
       
   537 		    if (validUntil.Length())
       
   538 		        {
       
   539 		        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,validUntil);
       
   540 		        User::LeaveIfError(iWSOviServiceSession->SessionContext()->Update(WSOviContextKeys::KTokenValidUntilTime,validUntil));
       
   541 		        }
       
   542 			else
       
   543 				{
       
   544 				TTime tmpValidUntil = Time::MaxTTime();
       
   545 				TBuf8<SenDateUtils::KXmlDateTimeMaxLength> pValidUntil;
       
   546 				SenDateUtils::ToXmlDateTimeUtf8L(pValidUntil, tmpValidUntil);
       
   547 		        User::LeaveIfError(iWSOviServiceSession->SessionContext()->Update(WSOviContextKeys::KTokenValidUntilTime,pValidUntil));				
       
   548 				}	
       
   549 	        
   534 	        retVal = iWSOviServiceSession->SessionContext()->SetTokenKeysL(token);
   550 	        retVal = iWSOviServiceSession->SessionContext()->SetTokenKeysL(token);
   535 	        if (retVal)
   551 	        if (retVal)
   536 	            {
   552 	            {
   537 	            aErrorMessage = response;
   553 	            aErrorMessage = response;
   538 	            }
   554 	            }