- ABP Framework version: v7
- UI Type: Angular
- Database System: EF Core (SQL Server)
how to implement windows Authentication in ABP suite
22 Answer(s)
-
0
hi
We have a sample pull reqeust.
https://github.com/abpframework/abp/pull/8419
-
0
-
0
hi
You also need to configure the Windows authentication.
Services.AddAuthentication
https://learn.microsoft.com/en-us/aspnet/core/security/authentication/windowsauth
-
0
I want automatic login is that possible or do I must press windows button and then register by email ?
-
0
hi
You can override the
public virtual async Task<IActionResult> OnGetAsync()
of the Login page.This is the same as you click the
Windows
button.public override async Task<IActionResult> OnGetAsync() { var redirectUrl = Url.Page("./Login", pageHandler: "ExternalLoginCallback", values: new { ReturnUrl, ReturnUrlHash, }); var properties = SignInManager.ConfigureExternalAuthenticationProperties("Windows", redirectUrl); properties.Items["scheme"] = "Windows"; return await Task.FromResult(Challenge(properties, provider)); }
See the sign in code
https://github.com/search?q=repo%3Aabpframework%2Fabp%20ProcessWindowsLoginAsync&type=code
-
0
can I send you my code ? provide me your email please
-
0
hi
You can share a simple project. liming.ma@volosoft.com
-
0
its a fresh project can you just implement it and share it with me please
-
0
hi
ok, What's your email?
I will use OpenIddict as auth server.
-
0
hi saudalshammari2030@gmail.com
-
0
hi
Sent. The key code is
src\BookStore.Web\MyLoginModel.cs
-
0
I didn't receive anything on my email yet (already checked spam etc..). can you make sure that its sent please? I sent you an email reply to it with the project please
-
0
hi
I sent it again.
-
0
still I have to register by email , what I need is to integrate it with the active directory so once someone open the website it automatically log in
-
0
-
0
no email claim exist , I only got the name. should I add this id.AddClaim(new Claim(ClaimTypes.Email,result.Principal.FindFirstValue(ClaimTypes.Email))); ?
-
0
hi
no email claim exist
You can find a way to get an email from
result.Principal
or add a random email claim toid
. -
0
inside result.Principal about 22 claims first one is "Name" and "PrimarySid" and all others are "groupsid" , there is no email claim
-
0
-
0
hi
Try to use the
AbpClaimTypes.Email
as the claim type. -
0
thank you , now it works but user still need to press login button in order to login . is there a way to auto login on website enter
-
0
hi
Add
redirect
to your index page.if (!CurrentUser.IsAuthenticated) { return Redirect("/account/login); }