 |
|
|
 |
|
|
 |
|
 |
Hi, my name is Benjamin Intsiful, i have a problem -i.e is to say that i want a code that can be used to create a database to store only user accounts for a login form to authenticate the users.using c#
Any one with an idea
Thanks
|
|
|
|
 |
|
 |
Alhamdulillah. It helped me when searching for a quick solution.
|
|
|
|
 |
|
 |
Using System.Security.Principal.GetCurrent() obtains current logged user, ok but...
using visual studio 2008, C#
we published a windows application, published as shared file (UNC PATH) and only available online
on a server running windows 2003 Server that belong to our domain (myDomain)
and we are using Sql Server as backend with windows integrated security enabled.
when a user try to run the application , it is prompted for credentials (i think it is prompted because the directory where the application resides its shared and not prompted for the application itself) , everything is work fine if the machine of the user belongs to domain and he/she supplied correct domain credentials, in the application. Security.Principal.GetCurrent() returns MyDomain\UserOfMyDomain and a string connection is constructed.
The problem is when the user is logged in a machine that is not part of myDomain , the user can access the shared folder where the application resides if he supplied the correct domain credentials when prompted, but when the application begins to run, Security principal.GetCurrent() doesn't return the credentials just entered, but returns
the credentials of the client machine , we expect something like MyDomain\UserOfMyDomain and we are getting some like
MACHINE-NAME\UserOfMachineName, and of course we cannot construct a correct string connection.
How can we obtain the credentials supplied to connect to the shared resource and use them in our app ?
Thanks in advance.
|
|
|
|
 |
|
 |
I did by your guide but when I run my wedsite on window server 2003, the username I received is "NETWORK SERVICE" not username for example "zorro" or another. Can you guide me how can get username login to window server 2003 and windowxp.
Thank you so much
|
|
|
|
 |
|
 |
Were you running a web application? The ASP.NET worker process runs under the network service account under Windows 2003.
|
|
|
|
 |
|
 |
yup, this is web application. So Is there anyway get username that login to window?
Please show me.
Thanks!
|
|
|
|
 |
|
 |
For web applications, I use this command:
this.Context.Request.ServerVariables["LOGON_USER"];
Craig C.
C code. C code run. Run code run!
|
|
|
|
 |
|
 |
It is the most useful thing to get user Login i got since yesterday. Thanx!
But it works only when users (which logins we want get) are allowed in Web.config
authorization
allow users="...,...";
deny users="*";
authorization
modified on Tuesday, December 22, 2009 5:13 AM
|
|
|
|
 |
|
 |
The call method in VBA is:
Public Sub SnodAnrop()
i = Module1.snod25x(host, port, user, pass, cert, cacert, service, arg, extra, result, buf)
End Sub
Declare Function snod25x Lib "sn25.dll" Alias "Snod25" (ByVal Host As String, ByVal Port As String, ByVal User As String, ByVal Passwd As String, ByVal Cert As String, ByVal CAert As String, ByVal Nodtjanst As String, ByVal Arg As String, ByVal Extra As String, ByVal Result As String, ByVal Resultbuf As Long) As Long
And i have come this far in C#:
[DllImport("sn25.dll", EntryPoint = "****")]
static extern int snod(string host, string port, string user, string passwd, string cert, string CAert, string Nodtjänst, string arg, string extra, string result, int buf);
private void button1_Click(object sender, EventArgs e)
{
int i = snod("", "", user, pass, "", "", service, arg, "",result, 1024);
}
The problem is that i dont get anything in return with the string result. The int i becomes 0 witch is OK.
Would appriciate some help
Thanks in advance!!
|
|
|
|
 |
|
|
 |
|
 |
Hi,
If my login id is abcdef, how do i query the active directory to get the User Name with this login id.
Many thanks for the help!!
rozhanin
|
|
|
|
 |
|
 |
If I run my application using "runas" then using they ways you have specified gives me the runas user not the logged on user. Any idea how to get that?
|
|
|
|
 |
|
 |
How do you get the logged on username of the user remotely?
|
|
|
|
 |
|
 |
Dear All,
I would like to display the login user name and password in a form in a C# prject. My code is :
private void Form1_Load(object sender, EventArgs e)
txtUserName.Text = Environment.UserName;
//txtPassword.Text =
}
I am being able to display the user name in the corresponding text box. But not being able to display the password of that user in txtPassword. For that I commented out the line. Can anybody help me please on this regard. I really need urgent help on this issue.
Regards,
Biswajit
|
|
|
|
 |
|
 |
Biswajit,
You can't retrieve the users password from Windows to display if that's what you are trying to do.
|
|
|
|
 |
|
 |
Dear Nick,
Can you tell me how can i get the users password. Because I want to make a users login screen in my project where there will be two text boxes one is txtUserName and another is txtPassword. The text boxes will reflect the values whatever the user inputted in the login screen of windows xp. I am being able to display the user name with my above mentioned code but not being able to display the password at all. I think there must be way to display it. Can you tell me some way to get it by writing some code or can you give me any idea about it ? Can you send me some code snippets rearding this matter. I need help from u on this issue.
Redards,
Biswajit
|
|
|
|
 |
|
 |
THere is no way of retrieving a users password, otherwise you could write a simple application on the web and get everyone's passwords.
You will have to write your system a different way.
ck
|
|
|
|
 |
|
 |
Is it possible to retieve user nt name from the web request? This question
arose while thinking about authentication system implementation in the
asp.net.
I want to make authentication process transparent for the user. E.g. if the
user is logged on the domain or is a member of the domain then perform
authentication automatically - as a result user won't experience any login
windows, otherwise web-app will provide the form similar the IIS one for
authentication.
Can this be done from the web application?
Thanks in Advance
Krishna
|
|
|
|
 |
|
|
 |
|
 |
Hello,
I keep getting the machine name I'm running on. This happens even when I try from other people's machine. My OS is XP. Any ideas?
Thanks,
Clank
Clank
|
|
|
|
 |
|
 |
The easiest way to get the user name using managed code is to use Environment.UserName.
I reject your reality and substitute my own!
- Adam Savage, Mythbuster
-George W Bush
life is like a roll of toilet paper. The closer it gets to the end, the faster it goes.
|
|
|
|
 |
|
 |
Here are different things I have tried and their result:
Request.ServerVariables["LOGON_USER"] - Returns nothing
System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString(); - Returns machine name /ASPNET
System.Environment.UserName.ToString() - Returns ASPNET
User.Identity.Name; - Returns nothing
Thanks,
Clank
|
|
|
|
 |
|
 |
I use "System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString(); " in ASP.Net, does it return "server machine name or Client machine name?" Because I need detect user login name, then display different web page. thanks!
|
|
|
|
 |