Hi! Where can I found an example of this configuration: use ADFS as an External Identity provider for IdSrv4? In another post I read this: "You have to setup IdSrv in ADFS as a relying party, and ADFS in IdSrv as an identity provider" but I dont know how can I do that.
In documentation I saw it may be done using Oidc: .AddOpenIdConnect("adfs", "ADFS", options =>{...});
But what is the configuration I need to do? Is the same for connecting to Azure AD, only changing the authority? I made the next configuration for Azure AD:
.AddOpenIdConnect("AAD", "Employees", options =>
{
options.SignInScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme;
options.SignOutScheme = IdentityServerConstants.SignoutScheme;
options.Authority = "https://login.microsoftonline.com/common";
options.ClientId = "<GUID for configured app in azure ad - apps>";
options.Scope.Add("openid");
options.Scope.Add("profile");
options.TokenValidationParameters = new TokenValidationParameters
{
ValidateIssuer = false
};
options.GetClaimsFromUserInfoEndpoint = true;
});
Thanks in advance.
Solution I found is:
Requirements:
Create an application group:
Configure authentication methods
Identity server configuration is:
services.AddAuthentication()
.AddOpenIdConnect("adfs", "AD authentication", options =>
{
options.SignInScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme;
options.SignOutScheme = IdentityServerConstants.SignoutScheme;
options.Authority = [https://adfsServiceUrl/adfs];
options.ClientId = [Client Identifier valued copied from ADFS configuration];
options.ResponseType = id_token;
options.CallbackPath = "/signin-adfs";
options.SignedOutCallbackPath = "/signout-callback-adfs";
options.RemoteSignOutPath = "/signin-adfs";
options.TokenValidationParameters = new TokenValidationParameters
{
NameClaimType = "name",
RoleClaimType = "role"
};
});
All set on this issue -- can we close?
The Identity Server config also needs the
options.ClientSecret = [Client generated shared secret from the ADFS];
otherwise it will error in the ADFS Event Logs
@churstz @gcardozoj does any one of you have a working example of identity server 4 using ADFS as external identity provider?
We are struggling to get additional claims like email, name or first name
@fabich this would be helpful if you could get a working example as I'm struggling to get Identity Server 4 working using ADFS also. Getting: AuthenticationException: The remote certificate is invalid according to the validation procedure.
Worked fine for me, but there was a step missing. Besides just enabling the scopes of openid, profile, email etc... I also had to go into the rules and map the unique_name, email address, etc... I also had to remove 2 lines of code from the above mentioned startup.cs code.
options.SignInScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme;
options.SignOutScheme = IdentityServerConstants.SignoutScheme;
Until this was removed, the claims information was always null.
Really appreciate the above. Was very helpful.
I am using ADFS Server 3.0 and I have to use OAuth instead of OpenIDConnect as ADFS 3 doesn't support OpenIDConnect. How can I achieve that ? Any working solution ?
@CShelton11 I'm on the same boat regarding the claims, so basically the Cookie that comes from ADFS only has the minimal claims needed (Like 2 or 3) and encrypted versions of it. I'll try commenting that out later but if we remove those lines what are the schemes defaulting to then?
There is another typo:
options.RemoteSignOutPath = "/signin-adfs";
should be
options.RemoteSignOutPath = "/signout-adfs";
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Solution I found is:
Requirements:
Create an application group:
Configure authentication methods
Identity server configuration is: