/// <summary>
        /// ######### ############ ######## ####### #######.
        /// </summary>
        /// <param name="request">######, ######## ######### ######### ####### #######.</param>
        public virtual void CheckCurrentAccessToken(SocialNetworkServiceRequest request)
        {
            AccessTokenInfo accessTokenInfo = DebugCurrentAccessToken(request);

            if (!accessTokenInfo.IsValid)
            {
                throw new InvalidAccessTokenException();
            }
        }
        protected virtual string GetLongLivedAccessToken(SocialNetworkServiceRequest request)
        {
            AccessTokenInfo accessTokenInfo      = GetLongLivedAccessTokenInfo(request);
            string          longLivedAccessToken = accessTokenInfo.AccessToken;

            if (longLivedAccessToken.IsNullOrEmpty())
            {
                throw new ItemNotFoundException("LongLivedAccessToken");
            }
            return(longLivedAccessToken);
        }
예제 #3
0
 public DebugAccessTokenResponse DebugAccessToken(SocialNetworkServiceRequest request)
 {
     try {
         AccessTokenInfo accessTokenInfo = ServerConnector.DebugAccessToken(request);
         return(new DebugAccessTokenResponse()
         {
             AccessTokenInfo = accessTokenInfo
         });
     } catch (Exception e) {
         return(ServerConnector.HandleException <DebugAccessTokenResponse>(e));
     }
 }
        protected string GetAppAccessToken(SocialNetworkServiceRequest request)
        {
            AccessTokenInfo appAccessTokenInfo = GetAppAccessTokenInfo(request);

            return(appAccessTokenInfo.AccessToken);
        }