Some help required: Different flavour of logon via FormsAuthentication?

From: Mike Kingscott (mike_at_kingscott.f9.co.uk)
Date: 07/25/03

  • Next message: Ash: "Datagrid on Webform - How to update? Help"
    Date: 24 Jul 2003 15:11:43 -0700
    
    

    Hi there,

    I've been doing some asp.net coding (finally), and I've created an app
    that takes in some data, validates it, performs a calculation and
    writes it to a db. My intention is to use Forms Authentication so that
    surfers have to enter an id (and only an id) in order to move around
    the site. Folder structure is thus:

    Broker (top level app folder, contains web.config, deny all unauth
    users)
      CP (Product Info folder, contains Apply Online aspx)

    So, all well and good. I'll have my login page in the Broker folder,
    and that will force anyone to login if they try to go to Broker or CP,
    then redirect them to where they want to go.

    But as usual, there's a kink in the line. In some cases, a single id
    will not suffice, there needs to be an identifier and an id, meaning a
    different login form, or altering the existing one. I could get the
    people who require two ids to go directly to the login page, and pass
    in a querystring parm that identifies that they are 'special', and
    alter the form and code behind accordingly.

    The question is, what then? I was thinking of storing their
    authentication details in a cookie (as seems to be common practice),
    utilising the user value part of the cookie to store details about
    them - basically, the surfer is resolved down to an agent id (which is
    good enough for 80% of the surfers), but the 'special' 20% need extra
    info to be resolved to that agent id.

    I could store the agent id in the User Name of the auth ticket, and
    then the extra info about them in the User Data auth ticket (i.e. the
    fact that they are 'special' and the required extra data).

    The big problem is, what happens when the cookie expires? They will be
    redirected to the login page (as they are no longer authenticated),
    and the app will have lost site of the fact that they are 'special',
    and present them with the standard login form. Could I store the fact
    that they are special in ViewState? I don't want to use Session as
    that will expire as well, same problem... I suppose I could set the
    cookie to expire in 12 hours, giving them plenty of time to do their
    work...

    Also, am I right in believing that once you're authenticated, that's
    it? I.e. the fact that some people are 'special' won't really matter
    in the call to Application_AuthenticateRequest?

    Ta all,

    Mike K.


  • Next message: Ash: "Datagrid on Webform - How to update? Help"

    Relevant Pages

    • Re: Cookies not written to specified directory
      ... which acts as a thunking layer between the login web ... IE 6 is some instances place the cookie in the following folder: ... It is not just our web application which write to this temp cookie folder, ...
      (microsoft.public.windows.inetexplorer.ie6.browser)
    • Re: how to by-pass forms authentication in a subfolder
      ... Use the element in the web.config to specify something like:- ... > web.config of the app root; so all users must login before they can access ... > any page within the app. ... > has to be the whole folder "testing" must be open to public, ...
      (microsoft.public.dotnet.framework.aspnet.security)
    • how to by-pass forms authentication in a subfolder
      ... so all users must login before they can access ... any page within the app. ... within "testing" folder to open to public w/o request users to login, ...
      (microsoft.public.dotnet.framework.aspnet.security)
    • Forms authentication not working right
      ... I have a subfolder protected with Forms Authentication. ... that folder is requested my login page comes up and the user is prompted to ... Once the user info is validated I create a cookie and setup the ...
      (microsoft.public.dotnet.framework.aspnet.security)
    • RE: Forms authentication not working right
      ... Check that the folder name is correct case. ... i think that your <authorization> element should be like this... ... > that folder is requested my login page comes up and the user is prompted to ... HttpCookie cookie; ...
      (microsoft.public.dotnet.framework.aspnet.security)