/// <summary> /// Compares two authorize requests for equality. /// </summary> /// <param name="AuthorizeRequest">A authorize request to compare with.</param> /// <returns>True if both match; False otherwise.</returns> public override Boolean Equals(AuthorizeRequest AuthorizeRequest) { if (AuthorizeRequest is null) { return(false); } return(IdToken.Equals(AuthorizeRequest.IdToken)); }
/// <summary> /// Returns true if MsalAuthenticationResult instances are equal /// </summary> /// <param name="other">Instance of MsalAuthenticationResult to be compared</param> /// <returns>Boolean</returns> public bool Equals(MsalAuthenticationResult other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return((IsCanceled == other.IsCanceled || IsCanceled != null && IsCanceled.Equals(other.IsCanceled)) && (IsError == other.IsError || IsError != null && IsError.Equals(other.IsError)) && (ErrorCode == other.ErrorCode || ErrorCode != null && ErrorCode.Equals(other.ErrorCode)) && (AccessToken == other.AccessToken || AccessToken != null && AccessToken.Equals(other.AccessToken)) && (IdToken == other.IdToken || IdToken != null && IdToken.Equals(other.IdToken)) && (Scopes == other.Scopes || Scopes != null && Scopes.Equals(other.Scopes)) && (ExpiresOn == other.ExpiresOn || ExpiresOn != null && ExpiresOn.Equals(other.ExpiresOn))); }
public override bool Equals(object obj) { if (obj == null) { return(false); } if (obj == this) { return(true); } return(obj is ObtainTokenResponse other && ((Context == null && other.Context == null) || (Context?.Equals(other.Context) == true)) && ((AccessToken == null && other.AccessToken == null) || (AccessToken?.Equals(other.AccessToken) == true)) && ((TokenType == null && other.TokenType == null) || (TokenType?.Equals(other.TokenType) == true)) && ((ExpiresAt == null && other.ExpiresAt == null) || (ExpiresAt?.Equals(other.ExpiresAt) == true)) && ((MerchantId == null && other.MerchantId == null) || (MerchantId?.Equals(other.MerchantId) == true)) && ((SubscriptionId == null && other.SubscriptionId == null) || (SubscriptionId?.Equals(other.SubscriptionId) == true)) && ((PlanId == null && other.PlanId == null) || (PlanId?.Equals(other.PlanId) == true)) && ((IdToken == null && other.IdToken == null) || (IdToken?.Equals(other.IdToken) == true)) && ((RefreshToken == null && other.RefreshToken == null) || (RefreshToken?.Equals(other.RefreshToken) == true)) && ((ShortLived == null && other.ShortLived == null) || (ShortLived?.Equals(other.ShortLived) == true))); }