I have an MVC intranet site that needs to use AD accounts for authentication.
I setup ADFS 3.0 (Win Server 2012 R2) and followed this to setup the ADFS Relying Party Trust.
This other post introduces the Ws-Federation OWIN components and I'd like to use it. It mentions how to connect to an Azure AD but nothing regarding ADFS.
I tried setting the configuration properties "MetadataAddress" and "Wtrealm" to match what I configured in ADFS but at runtime I get an error:
A default value for SignInAsAuthenticationType was not found in IAppBuilder Properties.
This can happen if your authentication middleware are added in the wrong order, or if one is missing.
I am looking for the proper way remove this error
Yeah.. I came across the same issue. Just do the following and it should work:
app.SetDefaultSignInAsAuthenticationType(WsFederationAuthenticationDefaults.AuthenticationType );
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = WsFederationAuthenticationDefaults.AuthenticationType
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With