Ask a Question related to ASP.NET Security, Design and Development.
-
Authentication 101
Hi All
I am new to .NET, this could be a very basic question
I would like to write a login page to capture username / password, and then
use window authentication to authenticate the user. I have done some
readings and come across with IPrinciple, WindowPrinciple .... but can
someone show me some sample code or a pointer to a documentation showing
some sample code, on what exactly to be used to perform a basic
authentication?
Thankyou very much.
dl
--
Guest
-
Accessing htm files without authentication (forms authentication)
I have application with forms authentication. All works fine. When user opens .aspx file gets login form, login and then get the .aspx page. But... -
ASP.Net Forms authentication with basic authentication popup
Relatively new to ASP.Net but have a strange problem. My site uses forms authentication for a large administration section however after the user... -
Forms authentication then redirection to a secure web with NT authentication?
Hi, I want to allow access to particular secured intranet web sites. These intranet are stored in sharepoint (2003 version) Actually I've... -
Authentication ticket, cookieless, forms authentication?
Hi. I want to use Forms Authentication, cookieless. The issue is setting the Authentication Ticket without using cookies (!) That is, the... -
Forms authentication with Windows authentication
Hi, I have an ASP.NET web site that uses IIS Basic Authentication and accesses an OLAP Server at various stages. The OLAP Server authentication... -
Joe Kaplan \(MVP - ADSI\) #2
Re: Authentication 101
Windows authentication is designed to work with the built-in browser
features to do authentication, not forms authentication. If you need to,
you can write your own forms authentication provider to do so, but you'll
have to do a lot of extra work to get this. Is it really necessary?
I'd suggest using the LogonUser API or SSPI to create a WindowsPrincipal
based on a username and password. Both of those will require p/invoke code
though. There are numerous samples available online.
Joe K.
<dl> wrote in message news:OHtDTdAIFHA.2476@TK2MSFTNGP12.phx.gbl...> Hi All
>
> I am new to .NET, this could be a very basic question
> I would like to write a login page to capture username / password, and
> then
> use window authentication to authenticate the user. I have done some
> readings and come across with IPrinciple, WindowPrinciple .... but can
> someone show me some sample code or a pointer to a documentation showing
> some sample code, on what exactly to be used to perform a basic
> authentication?
>
> Thankyou very much.
> dl
>
> --
>
>
>
Joe Kaplan \(MVP - ADSI\) Guest
-
jyjohnson #3
RE: Authentication 101
Perhaps this will work:
[url]http://www.codeproject.com/aspnet/ASPdotnet_LoginControl.asp[/url]
"dl" wrote:
> Hi All
>
> I am new to .NET, this could be a very basic question
> I would like to write a login page to capture username / password, and then
> use window authentication to authenticate the user. I have done some
> readings and come across with IPrinciple, WindowPrinciple .... but can
> someone show me some sample code or a pointer to a documentation showing
> some sample code, on what exactly to be used to perform a basic
> authentication?
>
> Thankyou very much.
> dl
>
> --
>
>
>
>jyjohnson Guest
-
Re: Authentication 101
Thanks.
After test driving a sample window authentication, I found I would need the
form authentication instead, but can I do it using LDAP ...?
/dl
"Joe Kaplan (MVP - ADSI)" <joseph.e.kaplan@removethis.accenture.com> wrote
in message news:%23UaDs8AIFHA.2456@TK2MSFTNGP09.phx.gbl...code> Windows authentication is designed to work with the built-in browser
> features to do authentication, not forms authentication. If you need to,
> you can write your own forms authentication provider to do so, but you'll
> have to do a lot of extra work to get this. Is it really necessary?
>
> I'd suggest using the LogonUser API or SSPI to create a WindowsPrincipal
> based on a username and password. Both of those will require p/invoke> though. There are numerous samples available online.
>
> Joe K.
>
> <dl> wrote in message news:OHtDTdAIFHA.2476@TK2MSFTNGP12.phx.gbl...>> > Hi All
> >
> > I am new to .NET, this could be a very basic question
> > I would like to write a login page to capture username / password, and
> > then
> > use window authentication to authenticate the user. I have done some
> > readings and come across with IPrinciple, WindowPrinciple .... but can
> > someone show me some sample code or a pointer to a documentation showing
> > some sample code, on what exactly to be used to perform a basic
> > authentication?
> >
> > Thankyou very much.
> > dl
> >
> > --
> >
> >
> >
>
Guest
-
Joe Kaplan \(MVP - ADSI\) #5
Re: Authentication 101
Do you want a WindowsPrincipal or are you ok with some type of generic
IPrincipal? If generic is ok, then you can just use LDAP. I'd still
suggest going the other route if you can, but that is up to you.
A quick Google search for Forms authentication and LDAP should turn up some
of the MS samples. They are not great, but they should get you started.
I still don't understand what's so important about forms authentication, but
I guess some people really want that in their applications. I'd rather not
have all the extra code to worry about if I don't need it, but that's just
me I guess.
Joe K.
<dl> wrote in message news:u14XFFIIFHA.1392@TK2MSFTNGP10.phx.gbl...> Thanks.
> After test driving a sample window authentication, I found I would need
> the
> form authentication instead, but can I do it using LDAP ...?
>
> /dl
> "Joe Kaplan (MVP - ADSI)" <joseph.e.kaplan@removethis.accenture.com> wrote
> in message news:%23UaDs8AIFHA.2456@TK2MSFTNGP09.phx.gbl...> code>> Windows authentication is designed to work with the built-in browser
>> features to do authentication, not forms authentication. If you need to,
>> you can write your own forms authentication provider to do so, but you'll
>> have to do a lot of extra work to get this. Is it really necessary?
>>
>> I'd suggest using the LogonUser API or SSPI to create a WindowsPrincipal
>> based on a username and password. Both of those will require p/invoke>>> though. There are numerous samples available online.
>>
>> Joe K.
>>
>> <dl> wrote in message news:OHtDTdAIFHA.2476@TK2MSFTNGP12.phx.gbl...>>>> > Hi All
>> >
>> > I am new to .NET, this could be a very basic question
>> > I would like to write a login page to capture username / password, and
>> > then
>> > use window authentication to authenticate the user. I have done some
>> > readings and come across with IPrinciple, WindowPrinciple .... but can
>> > someone show me some sample code or a pointer to a documentation
>> > showing
>> > some sample code, on what exactly to be used to perform a basic
>> > authentication?
>> >
>> > Thankyou very much.
>> > dl
>> >
>> > --
>> >
>> >
>> >
>>
>
Joe Kaplan \(MVP - ADSI\) Guest
-
JYJ #6
Re: Authentication 101
Joe -- Per a previous post, I can't create a new thread to use the
user's identity (I think it is always using the aspnet service account
identity). This thread needs to run a long-running process ( ~5
minutes) and then write some files out to a share on another server. If
I try the process without having it run on a new thread it works (well,
the files are created; I skip the long process so I could test it).
I've read some things about LogonUser, ReverttoSelf in advapi32, but I
can't get it to work...
Any ideas??!! <<Thanks>>
JYJ Guest
-
Joe Kaplan \(MVP - ADSI\) #7
Re: Authentication 101
This is a limitation of the way Thread.Start works in .NET 1.1. Dominick
Baier posted a fix that shows how to overcome this by passing the
WindowsIdentity you want to impersonate as a parameter on Thread.Start and
then calling WindowsIdentity.Impersonate on it. I'd suggest doing a quick
Google groups search to find this. It was within the last week.
You should not need to call LogonUser or RevertToSelf directly within your
thread code if you have the WindowsIdentity that you want to impersonate
already.
HTH,
Joe K.
"JYJ" <jonathan.y.johnson@gmail.com> wrote in message
news:1110307477.674638.84360@o13g2000cwo.googlegro ups.com...> Joe -- Per a previous post, I can't create a new thread to use the
> user's identity (I think it is always using the aspnet service account
> identity). This thread needs to run a long-running process ( ~5
> minutes) and then write some files out to a share on another server. If
> I try the process without having it run on a new thread it works (well,
> the files are created; I skip the long process so I could test it).
>
> I've read some things about LogonUser, ReverttoSelf in advapi32, but I
> can't get it to work...
>
> Any ideas??!! <<Thanks>>
>
Joe Kaplan \(MVP - ADSI\) Guest



Reply With Quote

