public Entity.LoginResponse RefreshToken(Entity.RefreshTokenRequest request)
 {
     try
     {
         var loginResult = _iotConnectClient.Login.RefreshToken("", new IOT.RefreshTokenModel()
         {
             RefreshToken = request.Token
         }).Result;
         //IOT.LoginResult loginResult = _iotConnectClient.Login.RefreshToken("", new IOT.RefreshTokenModel() { RefreshToken = request.Token }).Result;
         return(new Entity.LoginResponse
         {
             status = loginResult.data.status,
             data = loginResult.data.data,
             message = loginResult.message,
             token_type = loginResult.data.token_type,
             access_token = loginResult.data.access_token,
             refresh_token = loginResult.data.refresh_token,
             expires_in = loginResult.data.expires_in,
         });
     }
     catch (Exception ex)
     {
         _logger.ErrorLog(ex, "UserManager.ValidateUser " + ex);
         return(null);
     }
 }
Beispiel #2
0
 public Entity.LoginResponse RefreshToken(Entity.RefreshTokenRequest request)
 {
     try
     {
         var loginResult = _iotConnectClient.Login.RefreshToken("", new IOT.RefreshTokenModel()
         {
             RefreshToken = request.Token
         }).Result;
         //IOT.LoginResult loginResult = _iotConnectClient.Login.RefreshToken("", new IOT.RefreshTokenModel() { RefreshToken = request.Token }).Result;
         return(new Entity.LoginResponse
         {
             status = loginResult.data.status,
             data = loginResult.data.data,
             message = loginResult.message,
             token_type = loginResult.data.token_type,
             access_token = loginResult.data.access_token,
             refresh_token = loginResult.data.refresh_token,
             expires_in = loginResult.data.expires_in,
         });
     }
     catch (Exception ex)
     {
         _logger.ErrorLog(ex, this.GetType().Name, MethodBase.GetCurrentMethod().Name);
         return(null);
     }
 }
Beispiel #3
0
 public Entity.BaseResponse <Entity.LoginResponse> RefreshToken(Entity.RefreshTokenRequest request)
 {
     Entity.BaseResponse <Entity.LoginResponse> response = new Entity.BaseResponse <Entity.LoginResponse>(true, "");
     try
     {
         response.Data = GetApiResponse(_userService.RefreshToken(request));
     }
     catch (Exception ex)
     {
         base.LogException(ex);
         return(new Entity.BaseResponse <Entity.LoginResponse>(false, ex.Message));
     }
     return(response);
 }