-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update to .NET 8 with latest Duende.IdentityServer preview
- Loading branch information
Showing
29 changed files
with
1,113 additions
and
1,169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
{ | ||
"sdk": { | ||
"version": "7.0.102", | ||
"version": "8.0.100", | ||
"rollForward": "latestFeature" | ||
}, | ||
"additionalSdks": [ | ||
"6.0.403" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
src/alsami.Duende.IdentityServer.AspNetCore.Testing/Builder/IdentityServerHostBuilder.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
src/alsami.Duende.IdentityServer.AspNetCore.Testing/Services/IdentityServerProxy.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
using Microsoft.AspNetCore.Authorization; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace Duende.IdentityServer.Api | ||
namespace Duende.IdentityServer.Api; | ||
|
||
[Authorize] | ||
[ApiController] | ||
[Route("api/[controller]")] | ||
public class AuthController : ControllerBase | ||
{ | ||
[Authorize] | ||
[ApiController] | ||
[Route("api/[controller]")] | ||
public class AuthController : ControllerBase | ||
[HttpGet] | ||
public IActionResult TestAuth() | ||
{ | ||
[HttpGet] | ||
public IActionResult TestAuth() | ||
return new OkObjectResult(new | ||
{ | ||
return new OkObjectResult(new | ||
{ | ||
Message = "This endpoint would not be reachable, if the authentication was not working" | ||
}); | ||
} | ||
Message = "This endpoint would not be reachable, if the authentication was not working" | ||
}); | ||
} | ||
} |
10 changes: 3 additions & 7 deletions
10
test/Duende.IdentityServer.Api/Duende.IdentityServer.Api.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net6.0;net7.0</TargetFrameworks> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<TargetFramework>net8.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Condition="$(TargetFramework) == 'net6.0'"> | ||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.0" /> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="$(TargetFramework) == 'net7.0'"> | ||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.2" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
namespace Duende.IdentityServer.Api | ||
namespace Duende.IdentityServer.Api; | ||
|
||
public static class Program | ||
{ | ||
public static class Program | ||
public static void Main(string[] args) | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
throw new NotImplementedException("This application is not meant to be run manually!"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
test/Duende.IdentityServer.Server/Duende.IdentityServer.Server.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
using Duende.IdentityServer.Models; | ||
|
||
namespace Duende.IdentityServer.Server.Models | ||
namespace Duende.IdentityServer.Server.Models; | ||
|
||
public static class ApiResources | ||
{ | ||
public static class ApiResources | ||
{ | ||
public static IEnumerable<ApiResource> GetApiResources | ||
=> new List<ApiResource> | ||
{ | ||
new("api1", "api1") | ||
}; | ||
} | ||
public static IEnumerable<ApiResource> GetApiResources | ||
=> new List<ApiResource> | ||
{ | ||
new("api1", "api1") | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,35 @@ | ||
using Duende.IdentityServer.Models; | ||
|
||
namespace Duende.IdentityServer.Server.Models | ||
namespace Duende.IdentityServer.Server.Models; | ||
|
||
public static class Clients | ||
{ | ||
public static class Clients | ||
{ | ||
public const string Id = "sampleclient"; | ||
public const string Secret = "samplesecret"; | ||
public const string Id = "sampleclient"; | ||
public const string Secret = "samplesecret"; | ||
|
||
public static IEnumerable<Client> GetClients | ||
=> new List<Client> | ||
public static IEnumerable<Client> GetClients | ||
=> new List<Client> | ||
{ | ||
new() | ||
{ | ||
new() | ||
ClientId = Id, | ||
ClientSecrets = new List<Secret> | ||
{ | ||
new(Secret.Sha256()) | ||
}, | ||
AllowedScopes = new List<string> | ||
{ | ||
"api1", IdentityServerConstants.StandardScopes.OpenId, | ||
IdentityServerConstants.StandardScopes.Profile | ||
}, | ||
AllowedGrantTypes = new List<string> | ||
{ | ||
ClientId = Id, | ||
ClientSecrets = new List<Secret> | ||
{ | ||
new(Secret.Sha256()) | ||
}, | ||
AllowedScopes = new List<string> | ||
{ | ||
"api1", IdentityServerConstants.StandardScopes.OpenId, | ||
IdentityServerConstants.StandardScopes.Profile | ||
}, | ||
AllowedGrantTypes = new List<string> | ||
{ | ||
GrantType.ResourceOwnerPassword | ||
}, | ||
AllowOfflineAccess = true, | ||
AccessTokenLifetime = 60 * 60, | ||
RefreshTokenUsage = TokenUsage.OneTimeOnly, | ||
RefreshTokenExpiration = TokenExpiration.Absolute | ||
} | ||
}; | ||
} | ||
GrantType.ResourceOwnerPassword | ||
}, | ||
AllowOfflineAccess = true, | ||
AccessTokenLifetime = 60 * 60, | ||
RefreshTokenUsage = TokenUsage.OneTimeOnly, | ||
RefreshTokenExpiration = TokenExpiration.Absolute | ||
} | ||
}; | ||
} |
19 changes: 9 additions & 10 deletions
19
test/Duende.IdentityServer.Server/Models/IdentityResources.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
using Duende.IdentityServer.Models; | ||
|
||
namespace Duende.IdentityServer.Server.Models | ||
namespace Duende.IdentityServer.Server.Models; | ||
|
||
public static class ApiIdentityResources | ||
{ | ||
public static class ApiIdentityResources | ||
{ | ||
public static IEnumerable<IdentityResource> GetIdentityResources | ||
=> new List<IdentityResource> | ||
{ | ||
new IdentityResources.OpenId(), | ||
new IdentityResources.Profile() | ||
}; | ||
} | ||
public static IEnumerable<IdentityResource> GetIdentityResources | ||
=> new List<IdentityResource> | ||
{ | ||
new IdentityResources.OpenId(), | ||
new IdentityResources.Profile() | ||
}; | ||
} |
Oops, something went wrong.