Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,40 @@ namespace IdentityServer;
public static class Config
{
public static IEnumerable<IdentityResource> IdentityResources =>
new IdentityResource[]
{
new IdentityResources.OpenId(),
new IdentityResources.Profile(),
};
[
new IdentityResources.OpenId(),
new IdentityResources.Profile()
];

public static IEnumerable<ApiScope> ApiScopes =>
new ApiScope[]
{
new ApiScope("IdentityServer.Configuration"),
new ApiScope("SimpleApi")
};
[
new ApiScope("IdentityServer.Configuration"),
new ApiScope("IdentityServer.Configuration:SetClientSecret"),
new ApiScope("SimpleApi")
];

public static IEnumerable<Client> Clients =>
new Client[]
{
new Client
[
new()
{
ClientId = "client",
ClientName = "Client Credentials Client for DCR",

AllowedGrantTypes = GrantTypes.ClientCredentials,
ClientSecrets = { new Secret("secret".Sha256()) },

AllowedScopes = { "IdentityServer.Configuration" }
AllowedScopes = { "IdentityServer.Configuration", "IdentityServer.Configuration:SetClientSecret" }
}

};
];

//Needed for PipelineRegistration sample
public static IEnumerable<ApiResource> ApiResources =>
new ApiResource[]
{
new ApiResource("configuration", "IdentityServer.Configuration API")
[
new("configuration", "IdentityServer.Configuration API")
{
Scopes = { "IdentityServer.Configuration" },
ApiSecrets = { new Secret("secret".Sha256()) }
},
};
}
];
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Duende.IdentityServer.EntityFramework" Version="7.3.2" />
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="10.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.0">
<PackageReference Include="Duende.IdentityServer.EntityFramework" Version="7.4.4" />
<PackageReference Include="Serilog.AspNetCore" Version="10.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="10.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT License. See LICENSE in the project root for license information.


using System.Buffers.Text;
using System.Text;
using System.Text.Json;
using Duende.IdentityModel;
Expand All @@ -18,7 +19,7 @@ public ViewModel(AuthenticateResult result)
if (result?.Properties != null && result.Properties.Items.ContainsKey("client_list"))
{
var encoded = result.Properties.Items["client_list"];
var bytes = Base64Url.Decode(encoded);
var bytes = Base64Url.DecodeFromChars(encoded);
var value = Encoding.UTF8.GetString(bytes);

Clients = JsonSerializer.Deserialize<string[]>(value) ?? Enumerable.Empty<string>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"profiles": {
"SelfHost": {
"Self": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
Expand All @@ -9,4 +9,4 @@
"applicationUrl": "https://localhost:5001"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Duende.IdentityServer.Configuration" Version="7.3.2" />
<PackageReference Include="Duende.IdentityServer.Configuration.EntityFramework" Version="7.3.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.0" />
<PackageReference Include="Duende.IdentityServer.Configuration" Version="7.4.4" />
<PackageReference Include="Duende.IdentityServer.Configuration.EntityFramework" Version="7.4.4" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Configuration;
/// <summary>
/// This request processor can set the client secret, if it is supplied as a
/// property of the dynamic client registration request document. A special
/// scope is also
/// scope is also checked.
/// </summary>
public class PermissionsCheckingRequestProcessor : DynamicClientRegistrationRequestProcessor
{
Expand All @@ -29,7 +29,7 @@ public PermissionsCheckingRequestProcessor(IdentityServerConfigurationOptions op
{
if (context.Request.Extensions.TryGetValue("client_secret", out var secretParam))
{
// Remove the client_secret, so that we don't echo back a duplicate
// Remove the client_secret, so that we don't echo back a duplicate
// or inconsistent value
context.Request.Extensions.Remove("client_secret");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchBrowser": false,
"applicationUrl": "https://localhost:5002",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
},
"AllowedHosts": "*",
"ConnectionStrings": {
"DefaultConnection": "Data Source=../IdentityServer.db;"
"DefaultConnection": "Data Source=../../IdentityServer.db;"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Duende.IdentityModel" Version="7.1.0" />
<PackageReference Include="Duende.IdentityModel" Version="8.0.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Duende Software. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System.Buffers.Text;
using System.Text;
using System.Text.Json;
using Duende.IdentityModel;
Expand All @@ -22,8 +23,8 @@ public static void Show(this TokenResponse response)
var header = parts[0];
var payload = parts[1];

Console.WriteLine(PrettyPrintJson(Encoding.UTF8.GetString(Base64Url.Decode(header))));
Console.WriteLine(PrettyPrintJson(Encoding.UTF8.GetString(Base64Url.Decode(payload))));
Console.WriteLine(PrettyPrintJson(Encoding.UTF8.GetString(Base64Url.DecodeFromChars(header))));
Console.WriteLine(PrettyPrintJson(Encoding.UTF8.GetString(Base64Url.DecodeFromChars(payload))));
}
else
{
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading