webservices/wsoviplugin/src/wsovioauthclient.cpp
branchRCL_3
changeset 22 56092bff76ba
parent 20 32ab7ae9ec94
child 30 b72ea8487adb
--- a/webservices/wsoviplugin/src/wsovioauthclient.cpp	Tue May 25 13:53:20 2010 +0300
+++ b/webservices/wsoviplugin/src/wsovioauthclient.cpp	Wed Jun 09 10:53:28 2010 +0300
@@ -40,6 +40,7 @@
 #include "wsovitokencreationresponse.h"
 #include "sencryptoutils.h"
 #include "wsoviutils.h"
+#include <SenDateUtils.h>
 
 namespace 
     {
@@ -530,7 +531,22 @@
 	    else
 	        {
 	        iWSOviServiceSession->SetTrustAnchorL(iIdentityProvider->ProviderID());
-	            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviOAuthClient::ValidateL - set ctx basing on response");
+	        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviOAuthClient::ValidateL - set ctx basing on response");
+	        
+		    TPtrC8 validUntil = responseFragment->ValidUntil();
+		    if (validUntil.Length())
+		        {
+		        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,validUntil);
+		        User::LeaveIfError(iWSOviServiceSession->SessionContext()->Update(WSOviContextKeys::KTokenValidUntilTime,validUntil));
+		        }
+			else
+				{
+				TTime tmpValidUntil = Time::MaxTTime();
+				TBuf8<SenDateUtils::KXmlDateTimeMaxLength> pValidUntil;
+				SenDateUtils::ToXmlDateTimeUtf8L(pValidUntil, tmpValidUntil);
+		        User::LeaveIfError(iWSOviServiceSession->SessionContext()->Update(WSOviContextKeys::KTokenValidUntilTime,pValidUntil));				
+				}	
+	        
 	        retVal = iWSOviServiceSession->SessionContext()->SetTokenKeysL(token);
 	        if (retVal)
 	            {