{"id":7,"date":"2008-05-16T09:11:00","date_gmt":"2008-05-16T03:41:00","guid":{"rendered":"http:\/\/guganeshan.com\/blog\/?p=7"},"modified":"2009-12-18T14:02:03","modified_gmt":"2009-12-18T08:32:03","slug":"resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question","status":"publish","type":"post","link":"https:\/\/guganeshan.com\/blog\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html","title":{"rendered":"Resetting asp.net membership password when the user has forgotton the answer for the security question!"},"content":{"rendered":"<p>Here is the scenario&#8230; a web application has been implemented with the standard user management features&#8230; can create new users, the admin approves the users, can recover passwords and change security question + answer bla bla bla<\/p>\n<p>What happens if a user forgets the password?&#8230; simple, just goto the password recovery page and answer the security question and get the new password in the email.<\/p>\n<p>But what if he\/she doesn&#8217;t remember the answer for the security question???<!--more--><\/p>\n<p>Well, this is what happened exactly today. Although there were some solutions on the net, they required you to create a temporary Membership provider in the config etc.. which I didn&#8217;t like doing.<\/p>\n<p>But for my joy, I found <a href=\"http:\/\/geekswithblogs.net\/TimH\/archive\/2005\/09\/28\/55414.aspx\">this post<\/a> that gave me the idea. Although it is not a clean solution to the problem, it was what I wanted for the urgent need of resetting the password (since this won&#8217;t happen too often)<\/p>\n<p>The <a href=\"http:\/\/geekswithblogs.net\/TimH\/archive\/2005\/09\/28\/55414.aspx\">post<\/a> says that you have to replace the password hash and salt with the password hash and salt of a user whose password you know! What a simple idea. Well, whose password do I know?? mine of course!<\/p>\n<p>So this is what I did:<\/p>\n<ol>\n<li>Changed my password to something like password_999<\/li>\n<li>Replaced the user&#8217;s (who doesn&#8217;t remember the security answer) password hash and salt with my hash and salt<\/li>\n<li>Changed my password back<\/li>\n<li>Gave him &#8216;password_999&#8217; as the password, which he obviously will have to change once he logged in<\/li>\n<\/ol>\n<p>A more hassle-free solution would be to always have a dummy user account in the Membership database, which we can keep locked or as unapproved. And to make things even simpler, we can deploy an admin&#8217;s page that can accept the user name and replace the password hash and salt (copied from the dummy user account)&#8230;  thanks to <a href=\"http:\/\/geekswithblogs.net\/TimH\/Default.aspx\">Tim Huffam<\/a><\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Here is the scenario&#8230; a web application has been implemented with the standard user management features&#8230; can create new users, the admin approves the users, can recover passwords and change security question + answer bla bla bla What happens if a user forgets the password?&#8230; simple, just goto the password recovery page and answer the [&#8230;]<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,9],"tags":[23,30,29,68],"class_list":["post-7","post","type-post","status-publish","format-standard","hentry","category-programming","category-troubleshooting","tag-net","tag-asp-net","tag-tips","tag-troubleshooting"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Here is the scenario... a web application has been implemented with the standard user management features... can create new users, the admin approves the users, can recover passwords and change security question + answer bla bla bla What happens if a user forgets the password?... simple, just goto the password recovery page and answer the\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Guganeshan.T\"\/>\n\t<meta name=\"keywords\" content=\".net,asp.net,tips,troubleshooting\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/guganeshan.com\/blog\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"blog of Guganeshan.T |\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Resetting asp.net membership password when the user has forgotton the answer for the security question! | blog of Guganeshan.T\" \/>\n\t\t<meta property=\"og:description\" content=\"Here is the scenario... a web application has been implemented with the standard user management features... can create new users, the admin approves the users, can recover passwords and change security question + answer bla bla bla What happens if a user forgets the password?... simple, just goto the password recovery page and answer the\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/guganeshan.com\/blog\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2008-05-16T03:41:00+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2009-12-18T08:32:03+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Resetting asp.net membership password when the user has forgotton the answer for the security question! | blog of Guganeshan.T\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Here is the scenario... a web application has been implemented with the standard user management features... can create new users, the admin approves the users, can recover passwords and change security question + answer bla bla bla What happens if a user forgets the password?... simple, just goto the password recovery page and answer the\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html#article\",\"name\":\"Resetting asp.net membership password when the user has forgotton the answer for the security question! | blog of Guganeshan.T\",\"headline\":\"Resetting asp.net membership password when the user has forgotton the answer for the security question!\",\"author\":{\"@id\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/author\\\/guganeshan-t#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/#organization\"},\"datePublished\":\"2008-05-16T09:11:00+05:30\",\"dateModified\":\"2009-12-18T14:02:03+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html#webpage\"},\"articleSection\":\"Programming, Troubleshooting, .NET, ASP.NET, Tips, Troubleshooting\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/guganeshan.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/guganeshan.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/category\\\/programming#listItem\",\"name\":\"Programming\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/category\\\/programming#listItem\",\"position\":2,\"name\":\"Programming\",\"item\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/category\\\/programming\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html#listItem\",\"name\":\"Resetting asp.net membership password when the user has forgotton the answer for the security question!\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/guganeshan.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html#listItem\",\"position\":3,\"name\":\"Resetting asp.net membership password when the user has forgotton the answer for the security question!\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/category\\\/programming#listItem\",\"name\":\"Programming\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/#organization\",\"name\":\"blog of Guganeshan.T\",\"url\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/author\\\/guganeshan-t#author\",\"url\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/author\\\/guganeshan-t\",\"name\":\"Guganeshan.T\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/60a0704126253f7f297369c47e8197397ae6c6db285d2916d8aef0ba0faf4a97?s=96&r=g\",\"width\":96,\"height\":96,\"caption\":\"Guganeshan.T\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html#webpage\",\"url\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html\",\"name\":\"Resetting asp.net membership password when the user has forgotton the answer for the security question! | blog of Guganeshan.T\",\"description\":\"Here is the scenario... a web application has been implemented with the standard user management features... can create new users, the admin approves the users, can recover passwords and change security question + answer bla bla bla What happens if a user forgets the password?... simple, just goto the password recovery page and answer the\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/author\\\/guganeshan-t#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/author\\\/guganeshan-t#author\"},\"datePublished\":\"2008-05-16T09:11:00+05:30\",\"dateModified\":\"2009-12-18T14:02:03+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/\",\"name\":\"blog of Guganeshan.T\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/guganeshan.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Resetting asp.net membership password when the user has forgotton the answer for the security question! | blog of Guganeshan.T","description":"Here is the scenario... a web application has been implemented with the standard user management features... can create new users, the admin approves the users, can recover passwords and change security question + answer bla bla bla What happens if a user forgets the password?... simple, just goto the password recovery page and answer the","canonical_url":"https:\/\/guganeshan.com\/blog\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html","robots":"max-image-preview:large","keywords":".net,asp.net,tips,troubleshooting","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/guganeshan.com\/blog\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html#article","name":"Resetting asp.net membership password when the user has forgotton the answer for the security question! | blog of Guganeshan.T","headline":"Resetting asp.net membership password when the user has forgotton the answer for the security question!","author":{"@id":"https:\/\/guganeshan.com\/blog\/author\/guganeshan-t#author"},"publisher":{"@id":"https:\/\/guganeshan.com\/blog\/#organization"},"datePublished":"2008-05-16T09:11:00+05:30","dateModified":"2009-12-18T14:02:03+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/guganeshan.com\/blog\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html#webpage"},"isPartOf":{"@id":"https:\/\/guganeshan.com\/blog\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html#webpage"},"articleSection":"Programming, Troubleshooting, .NET, ASP.NET, Tips, Troubleshooting"},{"@type":"BreadcrumbList","@id":"https:\/\/guganeshan.com\/blog\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/guganeshan.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/guganeshan.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/guganeshan.com\/blog\/category\/programming#listItem","name":"Programming"}},{"@type":"ListItem","@id":"https:\/\/guganeshan.com\/blog\/category\/programming#listItem","position":2,"name":"Programming","item":"https:\/\/guganeshan.com\/blog\/category\/programming","nextItem":{"@type":"ListItem","@id":"https:\/\/guganeshan.com\/blog\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html#listItem","name":"Resetting asp.net membership password when the user has forgotton the answer for the security question!"},"previousItem":{"@type":"ListItem","@id":"https:\/\/guganeshan.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/guganeshan.com\/blog\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html#listItem","position":3,"name":"Resetting asp.net membership password when the user has forgotton the answer for the security question!","previousItem":{"@type":"ListItem","@id":"https:\/\/guganeshan.com\/blog\/category\/programming#listItem","name":"Programming"}}]},{"@type":"Organization","@id":"https:\/\/guganeshan.com\/blog\/#organization","name":"blog of Guganeshan.T","url":"https:\/\/guganeshan.com\/blog\/"},{"@type":"Person","@id":"https:\/\/guganeshan.com\/blog\/author\/guganeshan-t#author","url":"https:\/\/guganeshan.com\/blog\/author\/guganeshan-t","name":"Guganeshan.T","image":{"@type":"ImageObject","@id":"https:\/\/guganeshan.com\/blog\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/60a0704126253f7f297369c47e8197397ae6c6db285d2916d8aef0ba0faf4a97?s=96&r=g","width":96,"height":96,"caption":"Guganeshan.T"}},{"@type":"WebPage","@id":"https:\/\/guganeshan.com\/blog\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html#webpage","url":"https:\/\/guganeshan.com\/blog\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html","name":"Resetting asp.net membership password when the user has forgotton the answer for the security question! | blog of Guganeshan.T","description":"Here is the scenario... a web application has been implemented with the standard user management features... can create new users, the admin approves the users, can recover passwords and change security question + answer bla bla bla What happens if a user forgets the password?... simple, just goto the password recovery page and answer the","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/guganeshan.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/guganeshan.com\/blog\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html#breadcrumblist"},"author":{"@id":"https:\/\/guganeshan.com\/blog\/author\/guganeshan-t#author"},"creator":{"@id":"https:\/\/guganeshan.com\/blog\/author\/guganeshan-t#author"},"datePublished":"2008-05-16T09:11:00+05:30","dateModified":"2009-12-18T14:02:03+05:30"},{"@type":"WebSite","@id":"https:\/\/guganeshan.com\/blog\/#website","url":"https:\/\/guganeshan.com\/blog\/","name":"blog of Guganeshan.T","inLanguage":"en-US","publisher":{"@id":"https:\/\/guganeshan.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"blog of Guganeshan.T |","og:type":"article","og:title":"Resetting asp.net membership password when the user has forgotton the answer for the security question! | blog of Guganeshan.T","og:description":"Here is the scenario... a web application has been implemented with the standard user management features... can create new users, the admin approves the users, can recover passwords and change security question + answer bla bla bla What happens if a user forgets the password?... simple, just goto the password recovery page and answer the","og:url":"https:\/\/guganeshan.com\/blog\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html","article:published_time":"2008-05-16T03:41:00+00:00","article:modified_time":"2009-12-18T08:32:03+00:00","twitter:card":"summary","twitter:title":"Resetting asp.net membership password when the user has forgotton the answer for the security question! | blog of Guganeshan.T","twitter:description":"Here is the scenario... a web application has been implemented with the standard user management features... can create new users, the admin approves the users, can recover passwords and change security question + answer bla bla bla What happens if a user forgets the password?... simple, just goto the password recovery page and answer the"},"aioseo_meta_data":{"post_id":"7","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-01-11 15:27:29","updated":"2023-03-06 14:23:13","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/guganeshan.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/guganeshan.com\/blog\/category\/programming\" title=\"Programming\">Programming<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tResetting asp.net membership password when the user has forgotton the answer for the security question!\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/guganeshan.com\/blog"},{"label":"Programming","link":"https:\/\/guganeshan.com\/blog\/category\/programming"},{"label":"Resetting asp.net membership password when the user has forgotton the answer for the security question!","link":"https:\/\/guganeshan.com\/blog\/resetting-asp-net-membership-password-when-the-user-has-forgotton-the-answer-for-the-security-question.html"}],"_links":{"self":[{"href":"https:\/\/guganeshan.com\/blog\/wp-json\/wp\/v2\/posts\/7","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/guganeshan.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/guganeshan.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/guganeshan.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/guganeshan.com\/blog\/wp-json\/wp\/v2\/comments?post=7"}],"version-history":[{"count":4,"href":"https:\/\/guganeshan.com\/blog\/wp-json\/wp\/v2\/posts\/7\/revisions"}],"predecessor-version":[{"id":88,"href":"https:\/\/guganeshan.com\/blog\/wp-json\/wp\/v2\/posts\/7\/revisions\/88"}],"wp:attachment":[{"href":"https:\/\/guganeshan.com\/blog\/wp-json\/wp\/v2\/media?parent=7"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/guganeshan.com\/blog\/wp-json\/wp\/v2\/categories?post=7"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/guganeshan.com\/blog\/wp-json\/wp\/v2\/tags?post=7"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}