Duende.AccessTokenManagement.OpenIdConnect 3.0.1 to 3.1.1 #50
Unanswered
louisbouchard
asked this question in
IdentityServer
Replies: 3 comments
-
Can you please make sure there are no dependency issues with Microsoft.IdentityModel.* packages? Please use this doc as a guide. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hello Roland,
Thank you for your fast reply.
Everything is uptodate as you can see `
[cid:1bd5caf2-93cc-40d8-8c82-25f1d3ceaaa4]
And in the prj file :
```
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Remove="Resources\Components\Layout\MainLayout.fr-CA.resx" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\ForceDb.AuthorizationPolicies\ForceDb.AuthorizationPolicies.csproj" />
<ProjectReference Include="..\..\ForceDb.Shared\ForceDb.Shared.csproj" />
<ProjectReference Include="..\ForceDb.Client\ForceDb.Client.csproj" />
<PackageReference Include="Duende.AccessTokenManagement.OpenIdConnect" Version="3.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="9.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="9.0.2" />
<PackageReference Include="Telerik.UI.for.Blazor" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Components\Layout\MainLayout.fr-CA.resx" />
</ItemGroup>
<ItemGroup>
<Folder Include="Interfaces\ConfinedSpace\" />
</ItemGroup>
</Project>
```
In fact I use your OpenIdConnect as http message handler in my application.
Program.cs of the host :
```
builder.Services.AddOpenIdConnectAccessTokenManagement()
.AddBlazorServerAccessTokenManagement<CustomServerSideTokenStore>();
```
In the CustomServerSideTokenStore.cs
```csharp
public class CustomServerSideTokenStore : IUserTokenStore
{
private readonly ConcurrentDictionary<string, UserToken> _tokens = new();
public Task<UserToken> GetTokenAsync(ClaimsPrincipal user, UserTokenRequestParameters? parameters = null)
{
var sub = user.FindFirst("sub")?.Value ?? throw new InvalidOperationException("no sub claim");
if (_tokens.TryGetValue(sub, out var value))
{
return Task.FromResult(value);
}
return Task.FromResult(new UserToken { Error = "not found" });
}
public Task StoreTokenAsync(ClaimsPrincipal user, UserToken token, UserTokenRequestParameters? parameters = null)
{
var sub = user.FindFirst("sub")?.Value ?? throw new InvalidOperationException("no sub claim");
_tokens[sub] = token;
return Task.CompletedTask;
}
public Task ClearTokenAsync(ClaimsPrincipal user, UserTokenRequestParameters? parameters = null)
{
var sub = user.FindFirst("sub")?.Value ?? throw new InvalidOperationException("no sub claim");
_tokens.TryRemove(sub, out _);
return Task.CompletedTask;
}
}
```
No token using <PackageReference Include="Duende.AccessTokenManagement.OpenIdConnect" Version="3.1.1" />
[cid:7ccc2a6f-173d-457e-85bf-79f6091ddeb6]
And works under <PackageReference Include="Duende.AccessTokenManagement.OpenIdConnect" Version="3.0.1" />
[cid:5f52c742-7a89-4ab4-a66c-878de936462a]
Thank you for your help.
Have good one today.
…________________________________
De : RolandGuijt ***@***.***>
Envoyé : 17 février 2025 07:40
À : DuendeSoftware/community ***@***.***>
Cc : Bouchard, Louis ***@***.***>; Author ***@***.***>
Objet : Re: [DuendeSoftware/community] Duende.AccessTokenManagement.OpenIdConnect 3.0.1 to 3.1.1 (Discussion #50)
Can you please make sure there are no dependency issues with Microsoft.IdentityModel.* packages? Please use this doc<https://docs.duendesoftware.com/mim> as a guide.
If this isn't the solution, please report back.
—
Reply to this email directly, view it on GitHub<#50 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AB75YO5FCFN4U5JASH56WSL2QHKD3AVCNFSM6AAAAABXINJLQKVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEMRSGQZTKMY>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
0 replies
-
It seems like the images you were trying to post are lost. Can you please create a post directly on GitHub that includes them? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
IdentityServer version
7.1.0
.NET version
9
Description
After calling my remote API, I check the request message.
In the Header:Authorization I suppose to see the BEAR TOKEN but missing. (3.1.1) I have to use the version 3.0.1 to see it and make my API work. Any idead?
Reproduction steps
No response
Expected behavior
No response
Logs
No response
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions