custom authenticate users, how?

Discussion in 'ASP .Net' started by Jeff, May 14, 2009.

  1. Jeff

    Jeff Guest

    hi

    asp.net 3.5

    I'm wondering how to implement a custom authenication process.

    When the user loggs in I have to check if that user exists in another
    datasystem, if he exists then update the database with information about
    that user and authenticate the user....

    I thought Membership.ValidateUser did the trick but it only validates the
    username and passwords...
    what method do I need to invoke for it to authenticate the user?

    protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
    {
    }
     
    Jeff, May 14, 2009
    #1
    1. Advertising

  2. Jeff

    sloan Guest

    http://www.google.com/search?hl=en&q=asp.net Custom Membership Provider&aq=f&oq=

    Google "Custom Membership Provider"


    //authenticate the user//

    Huh?

    There are default and custom RoleProviders as well.

    What does "authenticate the user" mean to you?



    "Jeff" <> wrote in message
    news:%...
    > hi
    >
    > asp.net 3.5
    >
    > I'm wondering how to implement a custom authenication process.
    >
    > When the user loggs in I have to check if that user exists in another
    > datasystem, if he exists then update the database with information about
    > that user and authenticate the user....
    >
    > I thought Membership.ValidateUser did the trick but it only validates the
    > username and passwords...
    > what method do I need to invoke for it to authenticate the user?
    >
    > protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
    > {
    > }
    >
     
    sloan, May 14, 2009
    #2
    1. Advertising

  3. Jeff

    sloan Guest

    http://www.4guysfromrolla.com/articles/120705-1.aspx

    I would read those articles for a more bird's eye view of what
    Membership,Role and Profile providers can do, and how to work in a custom
    providers if needed.


    "Jeff" <> wrote in message
    news:%...
    > hi
    >
    > asp.net 3.5
    >
    > I'm wondering how to implement a custom authenication process.
    >
    > When the user loggs in I have to check if that user exists in another
    > datasystem, if he exists then update the database with information about
    > that user and authenticate the user....
    >
    > I thought Membership.ValidateUser did the trick but it only validates the
    > username and passwords...
    > what method do I need to invoke for it to authenticate the user?
    >
    > protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
    > {
    > }
    >
     
    sloan, May 14, 2009
    #3
  4. Jeff

    Jeff Guest

    //authenticate the user//

    I mean login the user


    "sloan" <> wrote in message
    news:...
    > http://www.google.com/search?hl=en&q=asp.net Custom Membership Provider&aq=f&oq=
    >
    > Google "Custom Membership Provider"
    >
    >
    > //authenticate the user//
    >
    > Huh?
    >
    > There are default and custom RoleProviders as well.
    >
    > What does "authenticate the user" mean to you?
    >
    >
    >
    > "Jeff" <> wrote in message
    > news:%...
    >> hi
    >>
    >> asp.net 3.5
    >>
    >> I'm wondering how to implement a custom authenication process.
    >>
    >> When the user loggs in I have to check if that user exists in another
    >> datasystem, if he exists then update the database with information about
    >> that user and authenticate the user....
    >>
    >> I thought Membership.ValidateUser did the trick but it only validates the
    >> username and passwords...
    >> what method do I need to invoke for it to authenticate the user?
    >>
    >> protected void Login1_Authenticate(object sender, AuthenticateEventArgs
    >> e)
    >> {
    >> }
    >>

    >
    >
     
    Jeff, May 14, 2009
    #4
  5. Jeff

    sloan Guest

    First you say:
    //but it only validates the
    username and passwords...//

    Then you say
    //authenticate the user//
    or
    //I mean login the user//

    And you say the first thing ("but it only validiates....") is *not* either
    of the second items listed.


    Huh?


    I would read the 4 guys article(s)..........then post some better questions.




    Here is your simplest (and not really useful) authentication:


    protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
    {

    bool isAuthenticated = true; // do your checks here // as is, this code
    is not very useful

    e.Authenticated = isAuthenticated ;

    Console.WriteLine(e.Authenticated.ToString());


    }




    "Jeff" <> wrote in message
    news:...
    > //authenticate the user//
    >
    > I mean login the user
    >
    >
    > "sloan" <> wrote in message
    > news:...
    >> http://www.google.com/search?hl=en&q=asp.net Custom Membership Provider&aq=f&oq=
    >>
    >> Google "Custom Membership Provider"
    >>
    >>
    >> //authenticate the user//
    >>
    >> Huh?
    >>
    >> There are default and custom RoleProviders as well.
    >>
    >> What does "authenticate the user" mean to you?
    >>
    >>
    >>
    >> "Jeff" <> wrote in message
    >> news:%...
    >>> hi
    >>>
    >>> asp.net 3.5
    >>>
    >>> I'm wondering how to implement a custom authenication process.
    >>>
    >>> When the user loggs in I have to check if that user exists in another
    >>> datasystem, if he exists then update the database with information about
    >>> that user and authenticate the user....
    >>>
    >>> I thought Membership.ValidateUser did the trick but it only validates
    >>> the username and passwords...
    >>> what method do I need to invoke for it to authenticate the user?
    >>>
    >>> protected void Login1_Authenticate(object sender, AuthenticateEventArgs
    >>> e)
    >>> {
    >>> }
    >>>

    >>
    >>

    >
    >
     
    sloan, May 14, 2009
    #5
  6. Jeff

    sqlman Guest

    On Thu, 14 May 2009 19:32:29 +0200, "Jeff"
    <> wrote:

    >hi
    >
    >asp.net 3.5
    >
    >I'm wondering how to implement a custom authenication process.
    >
    >When the user loggs in I have to check if that user exists in another
    >datasystem, if he exists then update the database with information about
    >that user and authenticate the user....
    >
    >I thought Membership.ValidateUser did the trick but it only validates the
    >username and passwords...
    >what method do I need to invoke for it to authenticate the user?
    >
    >protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
    >{
    >}
    >


    In a web service, one good approach is to employ SOAP headers and your
    own custom authentication module:
    http://msdn.microsoft.com/en-us/library/9z52by6a(VS.80).aspx

    This way you can build your own authentication layer that can depend
    on any kind of user profile storage (database, flat file, you name
    it...)

    When it comes to web pages, you can do Forms authentication or
    similar. More info here:
    http://msdn.microsoft.com/en-us/library/aa302415.aspx

    In both cases you can implement your own Identity and IPrincipal and
    make your roles work the way you want.
     
    sqlman, May 15, 2009
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sync Walantaji

    Authenticate users using AD and LDAP

    Sync Walantaji, Nov 15, 2004, in forum: ASP .Net
    Replies:
    7
    Views:
    11,569
    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=
    Nov 17, 2004
  2. Edwin Knoppert
    Replies:
    1
    Views:
    405
    Edwin Knoppert
    Sep 8, 2006
  3. Arpan

    Authenticate Users In Web.Config?

    Arpan, Sep 16, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    19,203
    Cowboy \(Gregory A. Beamer\)
    Sep 17, 2006
  4. Replies:
    1
    Views:
    449
    Manuel Ricca
    Dec 13, 2007
  5. JIM.H.

    Q: Authenticate users over domains

    JIM.H., Sep 25, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    394
    Anthony Jones
    Sep 30, 2008
Loading...

Share This Page