Hello :)
I have one Problem. I managed to get the authentication to ADFS.
In Startup.cs i have two configurations.
new ProjectName.Cookie.Configuration().Register(app);
public void Register(IAppBuilder app)
{
app.UseCookieAuthentication(
new CookieAuthenticationOptions
{
AuthenticationType =
WsFederationAuthenticationDefaults.AuthenticationType,
LoginPath = new PathString("/Account/Login")
});
}
new ProjectName.ADFS.Configuration().Register(app);
public void Register(IAppBuilder app)
{
var audienceRestriction = new AudienceRestriction(AudienceUriMode.Always);
audienceRestriction.AllowedAudienceUris.Add(new Uri(_realm));
var issuerRegistry = new ConfigurationBasedIssuerNameRegistry();
issuerRegistry.AddTrustedIssuer(_trustedIssuerThumbprint, _trustedIssuerName);
app.UseWsFederationAuthentication(new WsFederationAuthenticationOptions(WsFederationAuthenticationDefaults.AuthenticationType)
{
Wtrealm = _realm,
Configuration = new WsFederationConfiguration() { TokenEndpoint = _wsFederationTokenEndpoint },
TokenValidationParameters = new TokenValidationParameters
{
AuthenticationType = WsFederationAuthenticationDefaults.AuthenticationType
},
SecurityTokenHandlers = new System.IdentityModel.Tokens.SecurityTokenHandlerCollection
{
new SamlSecurityTokenHandlerEx
{
CertificateValidator = X509CertificateValidator.None,
Configuration = new SecurityTokenHandlerConfiguration()
{
SaveBootstrapContext = true,
AudienceRestriction = audienceRestriction,
IssuerNameRegistry = issuerRegistry,
}
}
}
});
}
The User Request a page, he get 302 response to ADFS, logĀ“s in and get back with the session cookie. The Problem is in which step i should create a DB user(save the user in de DB)?
Another Question: When i make an external Ajax call i get 302 redirect and the ajax call stops in this step, and this is ok. But how to call an ajax call with token to authenticate through the asp net boilerplate app.
Thank! :)
<cite>bytePlatz: </cite> One more catch, if you use WS-Federation + ADFS (or AzureAD) you don't need LDAP Auth. ADFS does that for you
Bruno
Hy :)
I seen that you have some implementation for ADFS. Is it a problem to share your implementation? :)
Tnx :)