Skip to content

Commit

Permalink
Merge pull request #179 from DuendeSoftware/joe/configuration-identit…
Browse files Browse the repository at this point in the history
…ymodel-7.0
  • Loading branch information
josephdecock authored Feb 15, 2024
2 parents db1f368 + 7ab25a1 commit 0045f32
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="IdentityModel" Version="6.1.0" />
<PackageReference Include="IdentityModel" Version="7.0.0-preview.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,6 @@ static async Task<DynamicClientRegistrationResponse> RegisterClient(string acces
var client = new HttpClient();
client.SetBearerToken(accessToken);

// var request = new DynamicClientRegistrationRequest
// {
// Address = "https://localhost:5001/connect/dcr",
// Document = JsonSerializer.Deserialize<DynamicClientRegistrationDocument>(
// """
// {
// "grant_types": [ "client_credentials" ],
// "scope": "SimpleApi",
// "client_secret": "hunter2"
// }
// """)
// };

var request = new DynamicClientRegistrationRequest
{
Address = "https://localhost:5002/connect/dcr",
Expand All @@ -73,7 +60,7 @@ static async Task<DynamicClientRegistrationResponse> RegisterClient(string acces
}
};

request.Document.Extensions.Add("client_secret", "hunter2");
request.Document.Extensions.Add("client_secret", AsJsonElement("hunter2"));

var response = await client.RegisterClientAsync(request);

Expand Down Expand Up @@ -123,3 +110,5 @@ static async Task CallServiceAsync(string token)
"\n\nService claims:".ConsoleGreen();
Console.WriteLine(response.PrettyPrintJson());
}

static JsonElement AsJsonElement(string s) => JsonDocument.Parse($"\"{s}\"").RootElement;
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Duende.IdentityServer.EntityFramework" Version="7.0.0" />
<PackageReference Include="Duende.IdentityServer.EntityFramework" Version="7.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="8.0.1" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.1" />
Expand Down

0 comments on commit 0045f32

Please sign in to comment.