Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login Signum with AD #540

Closed
doganc opened this issue Feb 9, 2022 · 7 comments
Closed

Login Signum with AD #540

doganc opened this issue Feb 9, 2022 · 7 comments

Comments

@doganc
Copy link

doganc commented Feb 9, 2022

Hi,
Could I use AD Authentication in Signum?
I added AD futures (Register User Entity with UserADMixin)
and also I can get AD users and mapping in Signum User list, but the related user can't log in,
when the user tries to log in (using AD password), the system gets Invalid Username or Password.

what is wrong with my operations or what is my forgetting thinks?

thanks,

@olmobrutall
Copy link
Collaborator

You want windows AD or Azure AD?

In any case you don’t need RegisterUser form, this is for open internet applications where users can register themselves. With AD integration the user is created automatically when they login for the first time.

@doganc
Copy link
Author

doganc commented Feb 9, 2022

I mean, Windows AD,
I'm using this button to get user from A.D.

image

after that, it's created in User list,

@olmobrutall
Copy link
Collaborator

olmobrutall commented Feb 9, 2022

you need an authorizer and set it you Starter.cs

AuthLogic.Authorizer = new SouthwindAuthorizer(() => Configuration.Value.ActiveDirectory);

https://github.com/signumsoftware/southwind/blob/master/Southwind.Logic/SouthwindAuthorizer.cs

in Startup.cs ConfigureServicrs you need:
services.AddAuthentication(IISDefaults.AuthenticationScheme);

In MainPublic.tsx you need:

AuthClient.registerWindowsAuthenticator();

Just after/before registerUserTicket();

Finally you need to install it and configure it in IIS

https://docs.microsoft.com/en-us/iis/configuration/system.webserver/security/authentication/windowsauthentication/

It’s a little bit complicated, best of luck 🤞

@olmobrutall
Copy link
Collaborator

Did it work? Can I close the issue?

@doganc
Copy link
Author

doganc commented Feb 15, 2022

Hi,
I didn't try yet, but I understand. Thanks,
you can close if get any problem I can ask again.

@doganc doganc closed this as completed Feb 15, 2022
@doganc
Copy link
Author

doganc commented Feb 20, 2022

Hi @olmobrutall
I add points of your detailed instructions to my code,
After that, I'm getting this error if I log in with System User

image

Refresh the page getting this error,

System.Security.Authentication.AuthenticationException (ExceptionID 2253)No authentication information found! at Signum.React.Authorization.AuthTokenServer.InvalidAuthenticator(FilterContext actionContext) in C:\SignumProjects\EmployeePortal\Framework\Signum.React.Extensions\Authorization\AuthTokensServer.cs:line 42 at Signum.React.Filters.SignumAuthenticationFilter.Authenticate(ResourceExecutingContext actionContext) in C:\SignumProjects\EmployeePortal\Framework\Signum.React\Filters\SignumFilters.cs:line 56 at Signum.React.Filters.SignumAuthenticationFilter.GetResource(ResourceExecutingContext context) in C:\SignumProjects\EmployeePortal\Framework\Signum.React\Filters\SignumFilters.cs:line 66 at Signum.React.Filters.SignumDisposableResourceFilter.OnResourceExecutionAsync(ResourceExecutingContext context, ResourceExecutionDelegate next) in C:\SignumProjects\EmployeePortal\Framework\Signum.React\Filters\SignumFilters.cs:line 165 at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

If I use the Login With Windows User button with Domain User (I got user from Active Directory and create a user automatically in User section), I'm getting this error,

image

Could you help me?
Thanks for all

@doganc doganc reopened this Feb 20, 2022
@doganc
Copy link
Author

doganc commented Feb 23, 2022

Hi, @olmobrutall,
Could you tell me what is the problem? it's a bit important for me,

Thanks for all

@doganc doganc closed this as completed Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants