Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. password policy using c#

password policy using c#

Scheduled Pinned Locked Moved C#
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    forest4ever
    wrote on last edited by
    #1

    Hai All. i am a newcomer of c# forum. i have problem with password policy implemetation in c# . i checking password character. but i have doubt in password changing days every 90 days clause in password policy . how to check whether password change required or not ?

    G M OriginalGriffO 3 Replies Last reply
    0
    • F forest4ever

      Hai All. i am a newcomer of c# forum. i have problem with password policy implemetation in c# . i checking password character. but i have doubt in password changing days every 90 days clause in password policy . how to check whether password change required or not ?

      G Offline
      G Offline
      Garth J Lancaster
      wrote on last edited by
      #2

      it depends on how and where the passwords are stored .. if you're using a database, one of the fields you might have in the account/user record is a datetime field for 'password last changed', and another might be a flag for 'needs to change password' a) at day=0, you force a refresh of all passwords by setting the 'needs to change password flag' to true, and probably just put junk in the password field to force them to use the accepted password change procedure b) when the user changes their password, you set the 'password last changed' field to (now), and the 'needs to change password' flag to false c) every day, you run a procedure to go through the 'database' and calculate the difference in days between (now) and the password last changed field - if that figure is '90' you set the 'needs to change password' flag to true

      1 Reply Last reply
      0
      • F forest4ever

        Hai All. i am a newcomer of c# forum. i have problem with password policy implemetation in c# . i checking password character. but i have doubt in password changing days every 90 days clause in password policy . how to check whether password change required or not ?

        M Offline
        M Offline
        Mycroft Holmes
        wrote on last edited by
        #3

        As an addition to Garths design, I would have a settings table that stores the policy details. Instead of storing the needs to change flag and requiring a daily process to update it I would use a View which joins the settings table and the user table and calcs the need to change flag. This eliminates a daily process and makes the policy and therefore the flag dynamic (controlled by the settings table and therefore available to be changed externally).

        Never underestimate the power of human stupidity RAH

        1 Reply Last reply
        0
        • F forest4ever

          Hai All. i am a newcomer of c# forum. i have problem with password policy implemetation in c# . i checking password character. but i have doubt in password changing days every 90 days clause in password policy . how to check whether password change required or not ?

          OriginalGriffO Offline
          OriginalGriffO Offline
          OriginalGriff
          wrote on last edited by
          #4

          Garth's way is fine, but rather than running a procedure every day, I'd do the "does it need changing" test when the user logged in. If it needs changing, then let him in, but take him directly to the "must change password" page, and don't let him in the rest of the site until it's changed. I'd also dump the boolean "needs changing" value in favour of replacing the "last change" date with a "next change date". That way, then test is simple "is next change less than now?" and it's only one column to update when they do change it: nextChangeDueOn = CurrentDate + 90 days.

          Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
          "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups