Skip to content

Commit

Permalink
revert unrelated codes
Browse files Browse the repository at this point in the history
  • Loading branch information
terencefan committed Dec 6, 2024
1 parent 3df417d commit 6e5d6f0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public ServiceEndpointProvider(ServiceEndpoint endpoint, ServiceOptions options)
public Task<string> GenerateClientAccessTokenAsync(string hubName = null, IEnumerable<Claim> claims = null, TimeSpan? lifetime = null)
{
var audience = $"{_audienceBaseUrl}{ClientPath}";

return _accessKey.GenerateAccessTokenAsync(audience, claims, lifetime ?? _accessTokenLifetime, _algorithm);
}

Expand Down
11 changes: 6 additions & 5 deletions src/Microsoft.Azure.SignalR.Common/Auth/LocalTokenProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ internal class LocalTokenProvider : IAccessTokenProvider

private readonly IEnumerable<Claim> _claims;

public LocalTokenProvider(AccessKey accessKey,
string audience,
IEnumerable<Claim> claims,
AccessTokenAlgorithm algorithm = AccessTokenAlgorithm.HS256,
TimeSpan? tokenLifetime = null)
public LocalTokenProvider(
AccessKey accessKey,
string audience,
IEnumerable<Claim> claims,
AccessTokenAlgorithm algorithm = AccessTokenAlgorithm.HS256,
TimeSpan? tokenLifetime = null)
{
_accessKey = accessKey ?? throw new ArgumentNullException(nameof(accessKey));
_algorithm = algorithm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public async Task<string> GenerateAccessTokenAsync(string audience,
AccessTokenAlgorithm algorithm,
CancellationToken ctoken = default)
{
if (!_initializedTcs.Task.IsCompleted || NeedRefresh)
if (!Initialized || NeedRefresh)
{
var source = new CancellationTokenSource(Constants.Periods.DefaultUpdateAccessKeyTimeout);
_ = UpdateAccessKeyAsync(source.Token);
Expand Down

0 comments on commit 6e5d6f0

Please sign in to comment.