DuendeSoftware / Samples

Samples for our Products
Other
225 stars 269 forks source link

DPoP and token exchange sample #124

Closed brockallen closed 1 year ago

brockallen commented 1 year ago

To show off the new IAccessTokenRetriever

leastprivilege commented 1 year ago

..and resource indicators?

brockallen commented 1 year ago

..and resource indicators?

Currently broken due to this bug: https://github.com/DuendeSoftware/Duende.AccessTokenManagement/issues/34

josephdecock commented 1 year ago

A little more context: I wrote an IAccessTokenRetriever that sets a resource indicator: https://github.com/DuendeSoftware/BFF/blob/main/samples/JS6/AudienceConstrainedAccessTokenRetriever.cs. That works (even with the bug Brock links to above). We think even simpler would be to set the resource parameter like this:

        endpoints.MapRemoteBffApiEndpoint("/api/user-token", "https://localhost:6001")
           .WithUserAccessTokenParameter(new BffUserAccessTokenParameters(resource: "urn:example-api"))
           .RequireAccessToken(TokenType.User);

But the bug that Brock links to above prevents this from working.