B
B
BaSO42016-06-08 23:56:23
LDAP
BaSO4, 2016-06-08 23:56:23

How to make authorization on LDAP Active Directory? How does it even work?

Here I have a client part in C #, I log in, I do this:

var credentials = new NetworkCredential(user_name, pass, domain); // user_name - имя одного из пользователей в Active Directory
var serverId = new LdapDirectoryIdentifier("<айпи>:389");
var ldapConnection = new LdapConnection(serverId, credentials);

TimeSpan mytimeout = new TimeSpan(0, 0, 0, 1);
ldapConnection.AuthType = AuthType.Basic;
ldapConnection.AutoBind = false;
ldapConnection.Timeout = mytimeout;
ldapConnection.Bind();

And on the server there is a server part, also in C #. It must somehow know that a user named user_name has just logged in. How to do it?
I do not use ASP.NET, on assignment I have to write my client-server application over HTTP or TCP / IP, and for authorization of clients in it LDAP.
I can't understand how it works at all, in particular how it's done in ASP.NET. I googled like "ldap get authorized user", there is essentially nothing, there is very little information in general.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Rou1997, 2016-06-09
@Rou1997

You are confusing something, Active Directory is just a repository of data about users, etc., of course, in ASP.NET it is accessed from the server, and not from the client (from the browser), which is technically impossible, in your the task meant to address from the server too.

S
Stanislav Makarov, 2016-06-09
@Nipheris

> according to the task I have to write my client-server application via HTTP or TCP/IP
An interesting task. So how should parts of an application communicate? Do you need a thick or thin client?
Authorization in ASP.NET is done using identity providers.
It's hard to come up with a less successful search query. To you what for "to receive the authorized user"?? You need to authenticate with ldap.
www.nuget.org/packages/Microsoft.IdentityModel.Cli... take a look, I don't even know which one to suggest.

R
Roman, 2016-06-10
@yarosroman

Well, everything is simpler here, authentication must be done on the server, and the server itself decides how to do it, its own accounts, LDAP, etc. and issues a session token to the client, and access to the server goes through the token. And what does ASP.Net have to do with it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question