Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider Extension Point for Token Acquisition #152

Closed
josephdecock opened this issue Nov 2, 2022 · 4 comments · Fixed by #172
Closed

Consider Extension Point for Token Acquisition #152

josephdecock opened this issue Nov 2, 2022 · 4 comments · Fixed by #172
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@josephdecock
Copy link
Member

josephdecock commented Nov 2, 2022

Consider adding a service in DI that abstracts how the BFF gets the tokens that it forwards to remote APIs. This would serve as an extension point that would allow a custom implementation to do complex things, e.g., token exchange before making the API call.

See DuendeSoftware/Support#301.

@brockallen brockallen transferred this issue from DuendeSoftware/Support Nov 2, 2022
@brockallen brockallen added the enhancement New feature or request label Nov 2, 2022
@Sen-Gupta
Copy link

I have hit this issue as well. Blazor WASM hosted, .Net 7.

We have a blazor hosted app, on www.mysite.com
The client connects to a hosted signalr application, signalr.mysite.com.

The client needs to connect SignalR client and it needs access token to build the connection.

We are getting IAccessTokerProvider as null in Dependency Injection.

hubConnection = new HubConnectionBuilder()
.WithUrl(NavigationManager.ToAbsoluteUri("/messageshub"), options =>
{
options.AccessTokenProvider = async () =>
{
var accessTokenResult = await tokenProvider.RequestAccessToken();
accessTokenResult.TryGetToken(out var accessToken);
return accessToken.Value;
};
})
.Build();

Is there a way, we can get token while using Bff?

@leastprivilege
Copy link
Member

Two things come to mind

  • token exchange
  • getting audience constrained tokens if resource isolation is being used

@brockallen
Copy link
Member

brockallen commented Apr 25, 2023

Two things come to mind
token exchange
getting audience constrained tokens if resource isolation is being used

Hmm, and would DPoP need to be a concern here? Looking at the code, this would not work today it seems. So we can release this as-is now, and then make DPoP work down the road, or add it now.

@brockallen brockallen added this to the 2.1.0 milestone May 31, 2023
@josephdecock josephdecock mentioned this issue Jun 15, 2023
@josephdecock josephdecock linked a pull request Jun 15, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants