Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

Commit

Permalink
Implement clone method rather than relying on Serialization (#1469)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewSteeples authored and bgavrilMS committed Jan 11, 2019
1 parent 828529d commit 9ba5664
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,18 @@ internal void UpdateTenantAndUserInfo(string tenantId, string idToken, AdalUserI
this.UserInfo = new AdalUserInfo(userInfo);
}
}

internal AdalResult Clone()
{
var result = new AdalResult(AccessTokenType, AccessToken, ExpiresOn, ExtendedExpiresOn)
{
Authority = Authority,
ExtendedLifeTimeToken = ExtendedLifeTimeToken,
};

result.UpdateTenantAndUserInfo(TenantId, IdToken, UserInfo);

return result;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,15 @@ public string Serialize()

internal AdalResultWrapper Clone()
{
return Deserialize(Serialize());
return new AdalResultWrapper()
{
Exception = Exception,
RawClientInfo = RawClientInfo,
RefreshToken = RefreshToken,
ResourceInResponse = ResourceInResponse,
UserAssertionHash = UserAssertionHash,
Result = Result.Clone()
};
}
}
}

0 comments on commit 9ba5664

Please sign in to comment.