1

To do a POC I created an API, MVC client, and IS4 on Asp.Net core and things work just fine.

OpenIdConnectOptions, as shown in the screen shot(https://puu.sh/C85fs/b60d0f0e37.png), is a class from Microsoft.AspNetCore.Builder and has properties like GetClaimsFromUserInfoEndPoint.

Problem is my IS4 is built on Asp.Net core but my MVC client is on ASP.Net MVC 4 framework and there we have OpenIdConnectAuthenticationOptions(https://puu.sh/C85qj/86676a62ee.png) which is class from Microsoft.Owin.Security.OpenIdConnect namespace and does not have the same property and to call UserInfoEndpoint, I think I will have to call it manually.

Am I missing something or Is this the way to do it?

Similarly to read the claim defined here in my user, it is very straightforward in ASP.Net core MVC client like below using HttpContext class(https://puu.sh/C85yf/6098ff9e9f.png)

https://puu.sh/C85vR/6304fb836d.png

while in order to do the same thing in a Non-core application, it is really difficult and in fact, I am not getting all claims defined in the user on the IS4 level(https://puu.sh/C85Ba/09c479ef18.png) in identity variable shown here https://puu.sh/C85DL/d8e87f711c.png

What is the best way to consume IS4 from an ASP.Net MVC 4 application? MVC client created on Asp.Net core is working completely fine but I have an old application which does not use ASP.Net core

Please suggest.

user1955255
  • 219
  • 4
  • 18
  • Are those user claims part of the openid or profile scopes, as configured on the ID Server (in ScopeClaims)? – sellotape Nov 26 '18 at 19:14
  • @sellotape you can see the user claims and scope set in this screenshot https://puu.sh/C8yJ2/e3697800c9.png is this good? – user1955255 Nov 27 '18 at 15:33
  • Yeah, slight mis-remembering of the v3 terminology by me there... but basically what I was trying to confirm was that the Claims you're missing are part of the Scopes you're requesting. But... as you say it works in non-Core it must be a client side issue instead. – sellotape Nov 27 '18 at 16:28
  • @user1955255 Did you make any progress on this? It looks very similar to what I have [here](https://stackoverflow.com/questions/53426753/failing-openid-connect-middleware-how-to-debug?noredirect=1#comment94171362_53426753). – guillaume31 Dec 07 '18 at 14:12
  • @guillaume31 I implemented IPorfileService interface and then I got it working – user1955255 Dec 14 '18 at 18:24

0 Answers0