Skip to content

Commit 0055cc8

Browse files
committed
AuthenticationClient. IsToken
1 parent f6b689c commit 0055cc8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Community/AuthenticationClient.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ public AuthenticationClient(Uri address)
5454
/// <inheritdoc />
5555
public ServerCredentials Credentials { get; }
5656

57+
/// <summary>
58+
/// Authorize by token.
59+
/// </summary>
60+
public bool IsToken { get; set; }
61+
5762
/// <inheritdoc />
5863
public ProductInfoMessage Product { get; set; }
5964

@@ -101,7 +106,10 @@ public Tuple<Guid, long> Login(ProductInfoMessage product, Version version, stri
101106
if (password.IsEmpty())
102107
throw new ArgumentNullException(nameof(password));
103108

104-
return HandleResponse(product, Invoke(f => f.Login4(product?.Id ?? 0, version.To<string>(), login, password.UnSecure())));
109+
return HandleResponse(product, Invoke(f =>
110+
IsToken
111+
? f.Login4(product?.Id ?? 0, version.To<string>(), login, password.UnSecure())
112+
: f.Login5(product?.Id ?? 0, version.To<string>(), password.UnSecure())));
105113
}
106114

107115
private Tuple<Guid, long> HandleResponse(ProductInfoMessage product, Tuple<Guid, long> tuple)

0 commit comments

Comments
 (0)