-
Notifications
You must be signed in to change notification settings - Fork 599
.net core api authentication using ws-federation #1918
Comments
Can you share the Fiddler trace file? Note WsFed is not appropriate for most API usage, JwtBearer is much better here. |
@MSAppsDev fyi your code sample works just fine for me on ADFS 2016. |
@rasitha1, i am trying it on adfs 2012. |
unfortunately i cannot use ad fs 2016, our Ops team setup ws-federation sign-in emitting jwt on ad fs 2012. Here is the response i am getting after entering credentials in login page. Since claims are null, it gets into loop for 6 to 8 (whatever is configured in ad fs retry) then errors out. |
Looks like WsFederationOptions is initialized with Saml and JWT token handlers however that's the wrong JWT token handler for this
So in order to get this working you need to change ADFS ( Does anyone know what's the point in having It seems like a wrapper WsFedJwtSecurityTokenHandler is needed for handling |
Finally made it work, here is the custom tokenvalidator if someone needs, this parses BinarySecurityToken from Base 64.
|
My .net core api is calling on-Prem ADFS (WS-Federation sign-in protocol) for authentication but context.User is always null after successful login. Below is my Startup.cs
I see that IDP is redirecting to my api and returning wresult with the token value but when i try to access context.User, it is null.
Any pointers on whats wrong here?
The text was updated successfully, but these errors were encountered: