Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8940043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:57:01+00:00 2026-06-15T10:57:01+00:00

I have an ASP.NET MVC web app which requires the user to login with

  • 0

I have an ASP.NET MVC web app which requires the user to login with their domain username and password by validating against ActiveDirectoryMembershipProvider.

On login I use ValidateUser(username, password) to validate the user’s credentials, and I then set the forms auth cookie so that in future requests the user is not asked to enter their username and password again

FormsAuthentication.SetAuthCookie(m.Username, true);

This is fine, but I need to periodically re-validate the user to make sure their domain password has not changed, and I don’t want them to have to enter their credentials again.

One way of doing this would just be to store the user’s password in plain text in the session object, or perhaps encrypting it then later decrypting it. Then I could call ValidateUser once more, and log the user out if necessary.

In other web apps where I’ve rolled my own auth I would simply store a hash of the user’s password and compare that to the hash stored in the database.

There doesn’t appear to be a single method on ActiveDirectoryMembershipProvider which would let me do that.

What is the logical thing to do here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:57:02+00:00Added an answer on June 15, 2026 at 10:57 am

    The answer is to periodically (every 30 minutes or so) check User.IsApproved and User.LastPasswordChangedDate to make sure the users credentials are still valid.

    To do this you need to manually create the FormsAuthenticationTicket and cookie, rather than using FormsAuthentication.SetAuthCookie.

    Put the date you validated the user inside UserData and compare this against LastPasswordChangedDate.

    I’ve implemented this and it works perfectly.

    More information here

    Check if Active Directory password is different from cookie

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an object which contains models for my ASP.NET MVC web app. The
I have a very simple asp.net mvc web app which uses castle active record,
We have an ASP.NET MVC web app which allows users to publish messages onto
I have an asp.net MVC web app that processes images and resizes them which
I have an ASP.NET MVC web app which includes the facility for clients to
I have an ASP.NET MVC web app which has a really basic subscription system
Im trying to develop my first ASP.NET MVC web app and have run into
I have an ASP.NET MVC web site. I have many actions which require authentication
I have an ASP.NET MVC web app whose controllers use WCF to call into
I am ASP.NET MVC to develop my application on web. This app requires a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.