Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Edward Dudley 80 posts 121 karma points
    Jan 26, 2010 @ 11:15
    Edward Dudley
    0

    Programatically Login a User

    Hi,

    I have a login system where a token is passed in the query string.  This token is decoded and contains the username and password of a user as well as some other info which is used in the business logic of deciding whether the token is valid or not.

    I'd really like to use this with the Umbraco Public access - is there an easy way I can programatically log in a user?  So the request hits a page, token is decoded, user logged in and then an internal redirect to the content which is protected by public access.

    I've been looking at writing a membership provider but I can't help feeling there must be a simpler way.

    Thanks!

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jan 26, 2010 @ 11:40
    Dirk De Grave
    0

    Edward,

    writing your own membership provider and overriding the ValidateUser() method in which you first decode your token to get username/password combination would be the best and simplest approach imo.

     

    Hope this helps.

    Regards,

    /Dirk

  • Edward Dudley 80 posts 121 karma points
    Jan 26, 2010 @ 11:51
    Edward Dudley
    0

    Thanks for the hint Dirk - I thought maybe a custom membership provider would be the way to go.  Useful article too!

    So I override ValidateUser(username, password) passing in the token as one of the parameters but how does public access know which member is logged in?  If ValidateUser returns true (after decoding the token), how do I supply the username?

    I guess the question is how public access determines the current logged on user is it?

Please Sign in or register to post replies

Write your reply to:

Draft