|
Home > Archive > Microsoft Content Management Server > April 2005 > CmsAuthenticationTicket, expired passwords
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
CmsAuthenticationTicket, expired passwords
|
|
| Donnie 2005-04-22, 5:58 pm |
| I need some help figuring something out. I am trying to add the functionality
to check and see if a users password is expired and give them the ability to
reser it.
My problem is the the CMS authentication ticket does not return and error
message that I am aware of. Any suggestions?
In my authentication I have code that resembles this:
________________________________________
_____
private void Login(string NTDomain, string NTUser, string NTPassword, string
npcUser)
{
NTDomain = NTDomain.Trim();
CmsAuthenticationTicket ticket;
try
{
// See if login ID needs to be converted
if(NTUser.IndexOf( "@" ) == -1)
{
//Convert login ID to proper format
NTUser = FormWinNTLoginName("WinNT://", NTDomain, NTUser);
}
// Login to MCMS using the credentials pass to this method
if (npcUser != null)
{
ticket = CmsFormsAuthentication.AuthenticateAsUser(NTUser,
NTPassword, npcUser, Common.NPCAccountType);
}
else
{
ticket = CmsFormsAuthentication.AuthenticateAsUser(NTUser,
NTPassword, Common.GetUserShortName(NTUser), Common.MCMSAccountType);
}
// If login succeeded
if( ticket != null )
{
// Redirect to the requested protected content
CmsFormsAuthentication.RedirectFromLoginPage(ticket, true, false);
}
//If it got here, it means the redirect didn't occur so the
username/password is not valid.
errorMessage.Text = "Invalid account or password. Check the spelling
and try again.";
errorMessage.Visible = true;
}
catch(Exception e)
{
throw new NpcException("Exception detected during login", e);
}
}
string FormWinNTLoginName(string domaintype, string domain, string user)
{
return domaintype + domain + "/" + user;
}
| |
| Stefan [MSFT] 2005-04-23, 7:46 am |
| Hi Donnie,
this is the wrong newsgroup for this.
MCMS does not provide any interfaces to check if the password is expired or
not.
Please check on an AD/Security related newsgroup or potentially on an IIS
related newsgroup as IIS provides features for password changes.
Cheers,
Stefan
--
This posting is provided "AS IS" with no warranties, and confers no rights
New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------
"Donnie" <donnie.baxter@navy.mil> wrote in message
news:CDCD92DA-81B3-4699-99CE-3E210D293289@microsoft.com...
> I need some help figuring something out. I am trying to add the
functionality
> to check and see if a users password is expired and give them the ability
to
> reser it.
>
> My problem is the the CMS authentication ticket does not return and error
> message that I am aware of. Any suggestions?
>
> In my authentication I have code that resembles this:
> ________________________________________
_____
>
> private void Login(string NTDomain, string NTUser, string NTPassword,
string
> npcUser)
> {
> NTDomain = NTDomain.Trim();
> CmsAuthenticationTicket ticket;
>
> try
> {
> // See if login ID needs to be converted
> if(NTUser.IndexOf( "@" ) == -1)
> {
> //Convert login ID to proper format
> NTUser = FormWinNTLoginName("WinNT://", NTDomain, NTUser);
> }
>
> // Login to MCMS using the credentials pass to this method
> if (npcUser != null)
> {
> ticket = CmsFormsAuthentication.AuthenticateAsUser(NTUser,
> NTPassword, npcUser, Common.NPCAccountType);
> }
> else
> {
> ticket = CmsFormsAuthentication.AuthenticateAsUser(NTUser,
> NTPassword, Common.GetUserShortName(NTUser), Common.MCMSAccountType);
> }
>
> // If login succeeded
> if( ticket != null )
> {
> // Redirect to the requested protected content
> CmsFormsAuthentication.RedirectFromLoginPage(ticket, true,
false);
> }
>
> //If it got here, it means the redirect didn't occur so the
> username/password is not valid.
> errorMessage.Text = "Invalid account or password. Check the
spelling
> and try again.";
> errorMessage.Visible = true;
> }
> catch(Exception e)
> {
> throw new NpcException("Exception detected during login", e);
> }
> }
>
> string FormWinNTLoginName(string domaintype, string domain, string user)
> {
> return domaintype + domain + "/" + user;
> }
|
|
|
|
|