Skip to content
Discussion options

You must be logged in to vote

The easiest method to go about this, would be to move the responsibility for generating the user-specific route on the frontend:

  • The frontend has access to the user claims by querying the /bff/user endpoint. This gives you the sub claim to use as userId in the API route.
  • In the BFF, add another remote API endpoint:
    app.MapRemoteBffApiEndpoint("/api/users", "https://remoteHost/users")
  • In the frontend again, rewrite the API call to go to https://bffHost/api/users/{sub-claim-value}/books

Another way to solve this on the BFF side, is to add a local API endpoint. In that endpoint's handler code, you can then also extract the sub claim for the current user and call the remote API.

There may …

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@ADringer
Comment options

@wcabus
Comment options

@ADringer
Comment options

Answer selected by ADringer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
BFF
Labels
None yet
2 participants