Skip to content

Commit

Permalink
Merge pull request #100 from leancodepl/feature/bump-identity-server-…
Browse files Browse the repository at this point in the history
…version

Bump identity server to 4.0 and update IdentityService
  • Loading branch information
Dragemil authored Aug 19, 2020
2 parents f0d1231 + d6afec8 commit 7b61ef0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ExtensionsVersion>5.0.0-preview.7.*</ExtensionsVersion>

<HangfireVersion>1.7.11</HangfireVersion>
<IdentityServerVersion>3.1.3</IdentityServerVersion>
<IdentityServerVersion>4.0.4</IdentityServerVersion>
<MassTransitVersion>6.2.4</MassTransitVersion>

<!-- Do not bump these dependencies if you don't want to force users to use newer .NET Core SDK -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using IdentityServer4.Models;
using IdentityServer4.Services;
Expand All @@ -15,9 +16,21 @@ public KeyMaterialService(SigningService signing)
this.signing = signing;
}

public Task<SigningCredentials> GetSigningCredentialsAsync()
public async Task<IEnumerable<SigningCredentials>> GetAllSigningCredentialsAsync()
{
return signing.GetSigningCredentialsAsync();
return new[] { await signing.GetSigningCredentialsAsync() };
}

public Task<SigningCredentials?> GetSigningCredentialsAsync(IEnumerable<string>? allowedAlgorithms = null)
{
if (allowedAlgorithms == null || !allowedAlgorithms.Any() || allowedAlgorithms.Contains(SecurityAlgorithms.RsaSha256))
{
return signing.GetSigningCredentialsAsync()!;
}
else
{
return Task.FromResult<SigningCredentials?>(null);
}
}

public async Task<IEnumerable<SecurityKeyInfo>> GetValidationKeysAsync()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private async Task<string> GetTokenAsync(string authority, string resource, stri
{
logger.Fatal(ex, "Cannot acqure access token from Azure AD");

throw ex;
throw;
}
}
}
Expand Down

0 comments on commit 7b61ef0

Please sign in to comment.