Login control FAQ :

Rate It (4)

Last post 12-17-2009 7:42 AM by jasbir_maan06. 23 replies.

Sort Posts:

  • Re: Login control FAQ :

    09-08-2009, 6:14 AM
    • Participant
      1,622 point Participant
    • jitendramcu
    • Member since 08-28-2009, 8:58 AM
    • Mumbai
    • Posts 285

     This is really nice tutorial for secure login. I need help regarding how to use role and membership in asp.net without using aspnet.mdf.

    Thanks,if it helps you then mark as "Answered"
    -----------------------------------------------
    Jitendra Kr.
    http://jitendra-aspnet.blogspot.com/


    Filed under:
  • Re: Login control FAQ :

    09-08-2009, 7:15 AM

    Yes you can have your customized way of handling it.  if you want to have it in your way, try to have a customized database.


    Eg: here is a very simple example for you to get an idea..


    User table has userid, username and etc

    Role table has role id and etc

    user_role table has userid, roleid and etc


    Avantha Siriwardana
    Beware of bugs in the above code; I have only proved it correct, not tried it.
    (Donald Knuth)
    http://www.linkedin.com/in/avanthasiriwardana
  • Re: Login control FAQ :

    09-08-2009, 10:51 AM
    • All-Star
      36,552 point All-Star
    • rtpHarry
    • Member since 10-01-2006, 12:51 PM
    • Lincoln, England
    • Posts 5,909

    jitendramcu:

     This is really nice tutorial for secure login. I need help regarding how to use role and membership in asp.net without using aspnet.mdf.


    Hey,

    Yes instead of using the basic database in app_data you can use sql server.

    To setup asp.net application services on sql server you can use aspnet_regsql.exe.

    I have written a tutorial for doing it via the commandline here:

    however you might just want to run the app directly and use the visual windows wizard front end.

  • Re: Login control FAQ :

    11-22-2009, 3:49 PM
    • Contributor
      2,963 point Contributor
    • guenavan
    • Member since 01-09-2004, 9:25 AM
    • Novossibirsk(S. Iberia)
    • Posts 1,331

    TATWORTH:
    I need to be able to block non-admins from using the site by an administrator making a change within the database and not by changing the web.config in the users folder. Conversely when the lock-out period is over, the administrator needs to be be able to allow normal user access to resume just by means of an administrator option. The site administrators are quite non-technical and hence changing any of the sub-directory web.configs is not an option.

    I could not understand:
    - why through making change in the database?
    - why subdirectory web.config?

    There are solutions for taking website available only to administrators:
    http://aspnet.4guysfromrolla.com/articles/110707-1.aspx

    http://www.west-wind.com/WebLog/posts/6397.aspx

     

    -------------------
    Guennadi Vanine - Gennady Vanin - Геннадий Ванин (Novosibirsk)
    Looking for an opportunity job

  • Re: Login control FAQ :

    11-23-2009, 12:58 AM
    • All-Star
      63,048 point All-Star
    • TATWORTH
    • Member since 02-04-2003, 1:34 PM
    • England
    • Posts 12,311
    • TrustedFriends-MVPs

    guenavan:
    I could not understand:
    - why through making change in the database?
    - why subdirectory web.config?

    There are periods of operation when only administrators should have access to the site. At the end of this period, normal operation needs to be restored without making any change other than the in the database.

    Don't forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
  • Re: Login control FAQ :

    11-23-2009, 2:54 AM
    • All-Star
      36,552 point All-Star
    • rtpHarry
    • Member since 10-01-2006, 12:51 PM
    • Lincoln, England
    • Posts 5,909

    TATWORTH:

    guenavan:
    I could not understand:
    - why through making change in the database?
    - why subdirectory web.config?

    There are periods of operation when only administrators should have access to the site. At the end of this period, normal operation needs to be restored without making any change other than the in the database.

    I didn't realise you were still looking for a solution to this! A couple of ways you could do this off the top of my head:

    Handle the logging in event of your login control and check to see if the user is admin or not and if the site is in lock down mode.

    Create a custom membership provider that handles the lock down by overriding the IsApproved flag of the user to return false during periods of lockdown

  • Re: Login control FAQ :

    11-23-2009, 3:07 AM
    • Contributor
      2,963 point Contributor
    • guenavan
    • Member since 01-09-2004, 9:25 AM
    • Novossibirsk(S. Iberia)
    • Posts 1,331

    TATWORTH:
    There are periods of operation when only administrators should have access to the site.
    At the end of this period, normal operation needs to be restored without making any change other than the in the database
     

    I cannot understand why editing of web.config files of subdirectories could have possibly be engaged for this

    -------------------
    Guennadi Vanine - Gennady Vanin - Геннадий Ванин (Novosibirsk)
    Looking for an opportunity job

  • Re: Login control FAQ :

    11-23-2009, 5:02 PM
    • All-Star
      36,552 point All-Star
    • rtpHarry
    • Member since 10-01-2006, 12:51 PM
    • Lincoln, England
    • Posts 5,909

    guenavan:

    I cannot understand why editing of web.config files of subdirectories could have possibly be engaged for this

    You can have individual authorization sections in sub-folders by putting web.configs in them and listing the access levels inside the .config.

    A technical user could edit a file and enable them to block off access to a folder but what Tatworth is saying is that he needs a solution that doesn't involve that because the websites admins are not that technical.

  • Re: Login control FAQ :

    12-17-2009, 7:42 AM
    • Member
      6 point Member
    • jasbir_maan06
    • Member since 12-17-2009, 7:14 AM
    • Posts 8

    For single sign on you just need to  put the "machine key" tag in web.config using same key in both application

    <

    machineKey validationKey="282487E295028E59B8F411ACB689CCD6F39DDD21E6055A3EE480424315994760ADF21B580D8587DB675FA02F79167413044E25309CCCDB647174D5B3D0DD9141" decryptionKey="8B6697227CBCA902B1A0925D40FAA00B353F2DF4359D2099" validation="SHA1"/>

Page 2 of 2 (24 items) < Previous 1 2