Using ABP 8.3.3. Have not yet upgraded to the latest 10 version due to breaking changes. Currently on ABP Enterprise subscription.
Provide us with the following info:
đ§ Hint: If you are using the ABP Studio, you can see all the information about your solution from the configuration window, which opens when you right-click on the solution and click on the Solution Configuration button.
- Where can we intercept the call to ActiveDirectory in order to check login and also determine if user is authenticated? Note: setting the AD server in settings only partly gets you there. It still does not work, nor does it create an account when a usser registers. Tried this in ABP dotnetcore 10 and dotnet core 8 versions. We had to write code to authenticate the user in AD, but where to after this?
3 Answer(s)
-
0
- In ABP 8.3.3, there isnât a built-in âintercept the call to ActiveDirectoryâ hook in the login pipeline for on-prem Windows AD / LDAP the same way there is for OIDC/OAuth external providers. The âAD server in settingsâ you mentioned is not enough by itself to make ABP automatically authenticate against AD and auto-provision users.
- The supported/ABP-native place to plug in âauthenticate elsewhere, then create/sign-in an ABP userâ is the External Login pipeline (i.e., treat AD as an external identity provider). In practice for on-prem AD, you typically implement your own authentication handler/provider (LDAP bind / Kerberos / etc.), then sign in using ABP Identity by creating/finding an
IdentityUserand issuing the normal ABP auth cookie/token.
What to do (ABP 8.3.3, MVC, tiered)
Do AD authentication in the Auth Server (or IdentityServer/OpenIddict host)
- In a tiered solution, the âlogin happensâ in the AuthServer/IdentityServer app (depending on your template/version).
- Put your AD credential validation in the login flow there (e.g., custom login page model / custom action that validates username+password against AD).
After AD says âOKâ, create or find the ABP user and sign in
- The âwhere to after this?â part is: create/find
IdentityUserand sign in via ASP.NET Core Identity (so ABP can do permissions/auditing/tenancy/etc.). - Conceptually:
- Look up user in ABP by username/email.
- If not found, create it (and set email/name fields from AD if you have them).
- Optionally add an external login record (provider name like
"LDAP"and provider key like ADâs GUID/UPN) if you want it tracked like an external provider. - Then call the normal sign-in manager to issue the auth cookie / token.
- The âwhere to after this?â part is: create/find
Do NOT expect âRegisterâ to create AD accounts
- ABPâs register page creates users in the ABP database/Identity store, not in AD.
- If you need âregistrationâ to mean âcreate in ADâ, that is a separate provisioning process (and usually not allowed in many enterprises). Youâd have to customize registration to call your AD provisioning logic.
If you want automatic user creation on first login
- Use the same logic in the login callback (after AD validation) to create the ABP
IdentityUserrecord the first time that AD user signs in.
- Use the same logic in the login callback (after AD validation) to create the ABP
Verified references (closest applicable ABP guidance)
- ABP account module overview (login/registration are ABP Identity-based): https://abp.io/docs/latest/modules/account
- ABPâs general statement about authentication capabilities (mentions AD/LDAP as an integration scenario, but not a built-in âhook pointâ API): https://abp.io/docs/latest/others/why-abp-platform
This response was generated by AI. If it didnât solve your problem, feel free to post a new answer â our support team will jump in to help you soon.
-
0
Where in code do we start?
If you want automatic user creation on first login
Use the same logic in the login callback (after AD validation) to create the ABP IdentityUser record the first time that AD user signs in.
-
0
Another issue is it seems the AD being looked for is some generic AD, not windows AD. Many code changes for AD had to be made to finally authenticate. Even then, it seems something is missing. Shouldn't be this much work.