0
votes

I got a simple solution where i am trying to make a call to UserInfoEndpoint from WebApi Server to get more information on user:

  • WebAPI Server
  • IdentityServer4
  • Angular5 frontend

Currently I cannot figure out a way to do this, as UserInfoEndpoint is secured and thus needs authorisation token.

Is there any way i can make a call from WebApi to UserInfoEndpoint to obtain this information?

My current workaround is to load up the JWT Token with all the information, but that is excessive.

1
How are you authenticating against IDS. Through the angular app with the javascript client? - m3n7alsnak3
Just standard implicit flow as per identityserver4 documentation. - Aeseir

1 Answers

0
votes

Assuming the front end is passing a token to the webapi then you just need to ensure that said token has the correct scopes and then you can use said token to call the UserInfo endpoint as needed.

As for how to extract the token from the current request context, I suspect the best way would be to hook up to a middleware event and store it in HttpContent.Items or suchlike for later use.