Hi, I want to use AD authentication for Authenticating asp.net zero application.
Question:
- How to signup active directory user in asp.net zero application?
- Do I need to create user in asp.net zero application for each Active directory user? if yes how to map Active directory user and asp.net zero application user? OR asp.net zero will automatically create user in asp.net zero application?
- Want to use asp.net zero authorization and AD authentication.
Please guide.
Thank you! Prashant
13 Answer(s)
-
0
Hi @vrpatlola,
When a user logins with LDAP, a user will be created on AspNet Zero automatically. After user creation on AspNet Zero, if you set a password for this user using user edit modal, user can login both with AD and regular AspNet Zero login.
By default, you can use LDAP is single tenant mode but it is possible to use it multi-tenant mode if you would like to by changing a few lines of code.
If you don't know how to enable LDAP, please go to <a class="postlink" href="https://aspnetzero.com/Documents/Development-Guide">https://aspnetzero.com/Documents/Development-Guide</a>, select your version and in the opening page go to "Enabling LDAP (Active Directory) Authentication".
-
0
<cite>ismcagdas: </cite> Hi @vrpatlola,
When a user logins with LDAP, a user will be created on AspNet Zero automatically. After user creation on AspNet Zero, if you set a password for this user using user edit modal, user can login both with AD and regular AspNet Zero login.
By default, you can use LDAP is single tenant mode but it is possible to use it multi-tenant mode if you would like to by changing a few lines of code.
If you don't know how to enable LDAP, please go to <a class="postlink" href="https://aspnetzero.com/Documents/Development-Guide">https://aspnetzero.com/Documents/Development-Guide</a>, select your version and in the opening page go to "Enabling LDAP (Active Directory) Authentication".
I am using asp.net zero (Angular + Asp.Net Core ) and Target framework is 4.6.1 I have enabled LDAP , but when I try to login with AD account is showing me "An internal error occurred during your request!" Please guide !
Thank you!
-
0
Check your Logs.txt.
-
0
In logs it showing following message
Hosting environment: Production Content root path: C:\inetpub\wwwroot\ad_fbmwebapi Now listening on: <a class="postlink" href="http://localhost:20156">http://localhost:20156</a> Application started. Press Ctrl+C to shut down.
In Chrome console showing : .../api/TokenAuth/Authenticate 500 (Internal Server Error)
Thank you! Prashant
-
0
@vrpatlola corret log file shot be App_Data/Logs/Logs.txt or App_Data/Logs.txt. Could you check that ?
-
0
@vrpatlola did you resolve the issue? I am also getting the same error. Please share the steps if you are able to resolve it.
-
0
Hi @gowthamv,
What is the error message you are seeing ?
-
0
Hi,
The server is running with the same domain, Please see the below Error State from Operation logs
System.NullReferenceException: Object reference not set to an instance of an object. at Abp.Authorization.Users.AbpUser
1.SetNormalizedNames() at Abp.Authorization.AbpLogInManager
3.<TryLoginFromExternalAuthenticationSources>d__41.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Abp.Authorization.AbpLogInManager3.<LoginAsyncInternal>d__37.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Abp.Authorization.AbpLogInManager
3.<LoginAsync>d__36.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Abp.Threading.InternalAsyncHelper.<AwaitTaskWithPostActionAndFinallyAndGetResult>d__51.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter
1.GetResult() at AspenTech.aspenPortalFramework.Web.Controllers.TokenAuthController.<GetLoginResultAsync>d__32.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult... -
0
Are you using a custom authentication source? ABP's LdapAuthenticationSource.CreateUserAsync returns a non-null User.
-
0
Not using any custom authentication source.
-
0
Hi @ismcagdas,
I am not using any custom auth source, see below error log
Error State from Operation logs
System.NullReferenceException: Object reference not set to an instance of an object. at Abp.Authorization.Users.AbpUser
1.SetNormalizedNames() at Abp.Authorization.AbpLogInManager
3.<TryLoginFromExternalAuthenticationSources>d__41.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Abp.Authorization.AbpLogInManager3.<LoginAsyncInternal>d__37.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Abp.Authorization.AbpLogInManager
3.<LoginAsync>d__36.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Abp.Threading.InternalAsyncHelper.<AwaitTaskWithPostActionAndFinallyAndGetResult>d__51.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter
1.GetResult() at AspenTech.aspenPortalFramework.Web.Controllers.TokenAuthController.<GetLoginResultAsync>d__32.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult... -
0
Hi @gowthamv
Can i check what is the value you used for the setting Abp.Zero.Ldap.ContextType?
-
0
Possible related to <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/3620">https://github.com/aspnetboilerplate/as ... ssues/3620</a>