CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.security Tags:
Item Type: NewsGroup Date Entered: 1/29/2008 2:01:02 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 0 Views: 64 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
1 Items, 1 Pages 1 |< << Go >> >|
Dave Alessi
Asp.Net User
Changing passwords in active directory from asp.net1/29/2008 2:01:02 PM

0/0

This is a followup post to using active directory for user validation.  I have been successful in making the validateUser method work, but am having trouble getting the changePassword function to work.  It seems that it has worked at least once, (perhaps the the very first time i try it), but usually fails.  I have verified that the password did actually change in active directory when it worked.   When I try a second time, I get the error "The password supplied is invalid. Passwords must conform to the password strength requirements configured for the default provider.".  On my domain controller, I checked the password rules and this shouldn't be happening (or I don't see what it causing it).  I have no minimums set.

If I remove the two lines  (minPasswordLength and minNonAlpha) from my config.sys, it give me an error that password must be 7 characters.  If I enter 7 characters, it gives me an alpha error.  If I include a password such as "1@a111111", it still gives me the "Non alpha numeric characters in 'newPassword' needs to be greater than or equal to '1'." error.  I can't seem to find the right combination.

Is there a way to make it respect the complexity rules setup for the domain?  Can anyone shed light on this?  Here is the code, and the web.config

public string ChangePassword(string domain, string username, string oldPassword, string newPassword)
{
try
{
if (domain.Length > 0)
username = username +
"@" + domain.ToString();
MembershipProvider mp = Membership.Providers["ADMembershipProvider"];
bool b = mp.ChangePassword(username, oldPassword, newPassword);
return b.ToString();
}
catch (Exception ex)
{
return ex.Message;
}
}

<?xml version="1.0"?>
<
configuration>
<
connectionStrings>
<
add name="CustomerConnectionString" connectionString="LDAP://mydomain.com"/>
</
connectionStrings>
<system.web>
<
compilation debug="true">
<
assemblies>
<
add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
</
assemblies>
</compilation>
<
authentication mode="Windows"/>
<
membership defaultProvider="ADMembershipProvider">
<
providers>
<
add name="ADMembershipProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="CustomerConnectionString"
connectionUsername=administrator@mydomain.com
connectionPassword="mypasswordt"
minRequiredPasswordLength="1"
minRequiredNonalphanumericCharacters="0"
/>
</
providers>
</
membership>
</system.web>
</
configuration>

1 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Pro ASP.NET for SQL Server: High Performance Data Access for Web Developers Authors: Brennan Stehling, Pages: 408, Published: 2007
Stealing the Network: How to Own the Box Authors: Ryan Russell, Jeff Moss, Pages: 448, Published: 2003
The .Net Developer's Guide to Directory Services Programming Authors: Joe Kaplan, Ryan Dunn, Pages: 479, Published: 2006
ASP.NET 2.0: Your Visual Blueprint for Developing Web Applications Authors: Chris Love, Pages: 339, Published: 2007
Professional ASP.NET 2.0 Security, Membership, and Role Management Authors: Stefan Schackow, Pages: 611, Published: 2006
Programming ASP.NET: Building Web Applications and Services with ASP.NET 2.0 Authors: Jesse Liberty, Dan Hurwitz, Pages: 930, Published: 2005
Check Point Ng Vpn-1/Firewall-1: Advanced Configuration and Troubleshooting Authors: Jim Noble, Doug Maxwell, ebrary, Inc, James Noble, Cherie Amon, Kyle X. Hourihan, Barry Stiefel, Robert Stephens, Chris Tobkin, Pages: 606, Published: 2003
Microsoft SharePoint 2007 For Dummies Authors: Vanessa L. Williams, Pages: 438, Published: 2007
Essential ASP.Net 2.0 Authors: Fritz Onion, Keith Brown, Pages: 345, Published: 2006
Beginning Ajax with ASP.NET Authors: Wallace B. McClure, Scott Cate, Paul Glavich, Craig Shoemaker, Pages: 403, Published: 2006

Web:
Primary Objects - Resetting Passwords in Active Directory with C# ... Changing a Password in Active Directory with C# ASP .NET. This is the case where you have the user's existing password. You want to verify the password they ...
CodeProject: Authenticating Active Directory user in ASP.NET. Free ... How to authenticate the AD user in ASP.NET by using Directory Services; ... Now I want that i want to check username & password in active directory, ... Change the message box to Response.write } // End of COde. Good Luck, Regards, ...
Change Active Directory Password Using ASP.Net - VB Dot NET Forum Change Active Directory Password Using ASP.Net. Options V ... 'users name and password instead of using an admin login to authenticate ...
@ How to change Password in Active Directory with ASP.NET 2 ? Hello, Could you show me a sample of asp.net 2 code that change the password of an user in Active Directory (windows server 2003) ? ...
Active Directory \ Directory Services - 123aspx.com ASP.NET ... How to change your windows 2000 password through C# project ... Using Active Directory In ASP.NET - Enumerate Active Directory Users - ASP. ...
Change user password in active directory. - ASP.NET Forums Hi All, To change the password in active directory I have used the following code but i`m getting exception saying as Unknown error (0x80005000). ...
microsoft.public.dotnet.framework.aspnet.security: Re: change ... Apr 27, 2004 ... In reply to: Sara rafiee: "Re: change password in active directory by webapplication (vb.net)"; Next in thread: Sara rafiee: "Re: change ...
How To: Use Forms Authentication with Active Directory in ASP.NET 2.0 ASP.NET version 2.0; Microsoft® Active Directory® directory service ... Locate the element, and then change the mode attribute to Forms. .... Create a new user with a strong password. The Active Directory membership ...
Resetting an Active Directory accounts' password... - ASP.NET Forums I'm trying to reset a password in Active Directory on a Windows 2000 Advanced Server. ... Any ideas on how do this utilizing the ASP.NET Framework 1.1 (in VB. ..... I used it on myself, and it does change the password, ...
411ASP.NET: ASP.NET Active Directory - ASP.NET tutorial, script ... Oct 12, 2003 ... NET Active Directory - ASP.NET tutorial, script, code, controls ... script will show you how to change a password for an account using ADSI. ...




Search This Site:










how to create this layout dynamically.

how debug an array or obj quickly

dnn 1.0.10 opera 7 as a moble device

how to make a hyperlink?

implementing custom memshipprovider class

ws-federation passive requestor profile

mobile server error in '/dotnetnuke' application

help with creating a custom checkboxlist control

how to learn asp.net

error while ttrying to use personalwebsite starters kit

inserting records into a tbl w/ a sub-relationship

php to asp.net c# help needed very small

no lock icon in browser with ssl on portal

performance of code

how to fix possible site errors

why do filenames have @"blah.txt"?

session variables and arrays

inserting data

asp2.0 wizard control, attach client script on finishbuttonclick

an object of a type convertible to 'int' is required -- please help

timeout and different user login

are there any security risks with allowing people to download .exe files from a website?

2 little questions

problem with edit module..

upgrade from the genric c# communities to gotcommunitynet

downloading files through asp.net resulted to 0 bytes

contentplaceholder from master page disabled in .aspx page

site map error

data grid question

zip libary

 
All Times Are GMT