Highlighted

How to Redirect users to a password change page when Username is expired.

Explorer ,
Oct 30, 2019

Copy link to clipboard

Copied

Hi All,

   We are using ColdFusion 2018 and a Oracle 11G Database. I am trying to redirect users to a change password page when the username is expired.   Users are database users who access the ColdFusion front-end. As of now we get an error message as shown below.  Upon clicking login(submit button) , users go to the authenticate.cfm page which displays the error messsage shown below, instead of this I would like them to another page within the application called changepassword.cfm (I already have this page). What is the easisest way to do this redirection ?   Thanks for your help.

IQ

 

"Error Occurred While Processing Request. Please try again.

Error Executing Database Query. [Macromedia][Oracle JDBC Driver][Oracle]ORA-28001: the password has expired  The error occurred on line 28."
 
 
Adobe Community Professional
Correct answer by BKBK | Adobe Community Professional

Hi iq11, yes LDAP is possible. We in fact use it. But that is a new question.

 

Please close this thread as answered, and start a new thread with your LDAP question. In so doing, you will help others who come to the forum looking for a solution. 

Views

985

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How to Redirect users to a password change page when Username is expired.

Explorer ,
Oct 30, 2019

Copy link to clipboard

Copied

Hi All,

   We are using ColdFusion 2018 and a Oracle 11G Database. I am trying to redirect users to a change password page when the username is expired.   Users are database users who access the ColdFusion front-end. As of now we get an error message as shown below.  Upon clicking login(submit button) , users go to the authenticate.cfm page which displays the error messsage shown below, instead of this I would like them to another page within the application called changepassword.cfm (I already have this page). What is the easisest way to do this redirection ?   Thanks for your help.

IQ

 

"Error Occurred While Processing Request. Please try again.

Error Executing Database Query. [Macromedia][Oracle JDBC Driver][Oracle]ORA-28001: the password has expired  The error occurred on line 28."
 
 
Adobe Community Professional
Correct answer by BKBK | Adobe Community Professional

Hi iq11, yes LDAP is possible. We in fact use it. But that is a new question.

 

Please close this thread as answered, and start a new thread with your LDAP question. In so doing, you will help others who come to the forum looking for a solution. 

Views

986

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 30, 2019 0
Adobe Community Professional ,
Oct 31, 2019

Copy link to clipboard

Copied

To be sure I understand correctly, you wish to redirect users to a password change page when their database password expires. If so, then you could do something like

 

 

<!--- authenticate.cfm --->
<cfscript>
try {
 /* Authentication code involving database query */
} catch (database dbException) {
      /* Enable this, in the test phase at the beginning, to see what dbException.detail looks like when the exception occurs! (I have assumed that dbException.detail contains the phrase 'password has expired')*/
     /*writedump(dbException);*/
    if (dbException.detail contains "password has expired") {
        location (url="http://...etc./changePassword.cfm");
    }
	
}
</cfscript>

 

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 31, 2019 1
Explorer ,
Oct 31, 2019

Copy link to clipboard

Copied

Thanks BKBK, your help is much appreciated, this exactly what I am looking for.

  I tried modificying the authenticate.cfm file  as shown in the code below , the <cfscript> beginning tag is having a closing tag </cfscript> tag but I get an error which states

"The start tag must have a matching end tag. An explicit end tag can be provided by adding </cfscript>. If the body of the tag is empty, you can use the shortcut <cfscript .../>. The CFML compiler was processing: A cfscript tag beginning on line 106, column 2. A cfscript tag beginning on line 106, column 2."

 

 

-- Code used in authenticate.cfm is given below


<CFLOGINUSER name="#Session.UserName#" password="#Session.Password#" roles="">

<cfif dbtype is 'oracle'>
<cfscript>
try {
<cfquery name="LookUp" datasource="#datasource#" username=#Form.UserName# password=#Form.password#>
SELECT max(ipn) FROM dbo.look_up
</cfquery>
}
catch (database dbException) {
/* Enable this, in the test phase at the beginning, to see what dbException.detail looks like when the exception occurs! (I have assumed that dbException.detail contains the phrase 'password has expired')*/
/*writedump(dbException);*/
if (dbException.detail contains "password has expired") {
location (url="http://atfw01/aPS/changePassword.cfm");
}
}
</cfscript>

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 31, 2019 0
Adobe Community Professional ,
Oct 31, 2019

Copy link to clipboard

Copied

You get an error because of the incorrect mixing of script syntax and tag syntax. As you seem to prefer tags, use something like:

<cfif dbtype is 'oracle'>

	<cftry>
		<cfquery name="LookUp" datasource="#datasource#" username="#Form.UserName#" password="#Form.password#">
		    SELECT max(ipn) FROM dbo.look_up
		</cfquery>
	<cfcatch type="database">
		
		<!--- Enable this, in the test phase at the beginning, to see what dbException.detail looks like when the exception occurs! (I have assumed that dbException.detail contains the phrase 'password has expired')--->
		<!--- <cfdump var="#dbException#">--->
		<cfif dbException.detail contains "password has expired">
			<cflocation url="http://atfw01/aPS/changePassword.cfm">
		</cfif>
	</cfcatch>
	</cftry>

</cfif>

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 31, 2019 0
Adobe Community Professional ,
Nov 03, 2019

Copy link to clipboard

Copied

Hi iq11

Did you get this to work? Is your question answered?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 03, 2019 0
Explorer ,
Nov 05, 2019

Copy link to clipboard

Copied

yes it redirects to the Changepassword page but on the changepasswordaction page

the following code does not seem to get executed. Upon hitting submit the action page whoich nhas thew code as shown below is not getting executed the page continues to be on the same page where the users is asked to change password , the action page is not getting executed.,

 


 <cfquery name="changepassword" datasource="#datasource#" Username="#Form.login#" password="#Form.Password#">
  ALTER USER #FORM.LOGIN# IDENTIFIED BY #LCase(FORM.VERIFYPASSWORD)#
 </cfquery>

<script>
alert('Your password has been changed.')
document.location = 'default.cfm'
</script>

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 05, 2019 0
Explorer ,
Nov 07, 2019

Copy link to clipboard

Copied

Any updates on how to solve this ? 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 07, 2019 0
Adobe Community Professional ,
Nov 07, 2019

Copy link to clipboard

Copied

iq11 did you read the previous posts? I told you why you were getting errors and I suggested a solution.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 07, 2019 0
Explorer ,
Nov 08, 2019

Copy link to clipboard

Copied

yes I did read the suggestions and tried them, its working but the redirect page takes me to a change password page and from there when I hit the submit button the action program behing this does nt oseem to work, it just keeps the control on the same page. Code is shown below


<cfapplication name="eAPS"
SESSIONMANAGEMENT = "YES"
SESSIONTIMEOUT = #CreateTimeSpan(1,0,0,0)#
>
<CFERROR
TYPE="Exception"
TEMPLATE="error.cfm"
MAILTO="jdiri@einc.com"
>
<html>
<head>
<title>eAPS</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="_style1.css">
</head>
<body bgcolor="#FFFFFF">


<cfif #Form.newpassword# IS NOT #Form.verifypassword#>
<div align="center">
<p>&nbsp;</p>
<p>You have entered 2 different new passwords, it is possible you made a typo in either the new password or the verify password fields. Please <a href="ChangePassword.cfm">try
again</a>. </p>
</div>
<cfelse>

<cfquery name="changepassword" datasource="#datasource#" Username="#Form.login#" password="#Form.Password#">
ALTER USER #FORM.LOGIN# IDENTIFIED BY #LCase(FORM.VERIFYPASSWORD)#
</cfquery>
<script>
alert('Your password has been changed.');
document.location = 'default.cfm';
</script>

</cfif>

</body>
</html>

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 08, 2019 0
Adobe Community Professional ,
Nov 09, 2019

Copy link to clipboard

Copied

What you're now asking is a new question.

Your oriiginal question was:

"Upon clicking login(submit button) , users go to the authenticate.cfm page which displays the error messsage shown below, instead of this I would like them to another page within the application called changepassword.cfm (I already have this page). What is the easisest way to do this redirection ?"

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 09, 2019 0
Adobe Community Professional ,
Nov 09, 2019

Copy link to clipboard

Copied

What is the name of the page you've shown here?

What is the action of the form?

What do you want to happen between the form page and the page you've shown here?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 09, 2019 0
Explorer ,
Nov 12, 2019

Copy link to clipboard

Copied

The name of the page shown here changepasswordaction.cfm this is the action program which should be called when the previous page changepassword.cfm is used to click the submit button and it should get redirected to the homepage which is the login page but this does not happen and the user continues to be at the same page changepassword.cfm

What could be done to fix this ?

 

 

If I use <cftry> <cfactach> I see the following error code

 

  • Message: Error Executing Database Query.
  • Native error code: 28001
  • SQLState: HY000
  • Detail: [Macromedia][Oracle JDBC Driver][Oracle]ORA-28001: the password has expired

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 12, 2019 0
Adobe Community Professional ,
Nov 12, 2019

Copy link to clipboard

Copied

First and foremost, you have mistakenly placed the Application.cfm code here. Save it apart as follows:

 

Application.cfm

<cfapplication name="eAPS"
SESSIONMANAGEMENT = "YES"
SESSIONTIMEOUT = #CreateTimeSpan(1,0,0,0)#
>
<CFERROR
TYPE="Exception"
TEMPLATE="error.cfm"
MAILTO="jdiri@einc.com"
>

 

changepasswordaction.cfm

<html>
<head>
<title>eAPS</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="_style1.css">
</head>
<body bgcolor="##FFFFFF">


<cfif Form.newpassword IS NOT Form.verifypassword>
	<div align="center">
	<p>&nbsp;</p>
	<p>You have entered 2 different new passwords, it is possible you made a typo in either the new password or the verify password fields. Please <a href="ChangePassword.cfm">try
	again</a>. </p>
	</div>
<cfelse>

	<cfquery name="changepassword" datasource="#datasource#" Username="#Form.login#" password="#Form.Password#">
	ALTER USER <cfqueryparam cfsqltype="cf_sql_varchar" value="#FORM.LOGIN#"> IDENTIFIED BY <cfqueryparam cfsqltype="cf_sql_varchar" value="#LCase(FORM.VERIFYPASSWORD)#">
	</cfquery>
	<script>
	    alert('Your password has been changed.');
	    document.location = 'default.cfm';
	</script>

</cfif>

</body>
</html>

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 12, 2019 0
Explorer ,
Nov 13, 2019

Copy link to clipboard

Copied

Thanks bkbk, I think I could make some progress. But now I get the following error

 

Error Executing Database Query.
[Macromedia][Oracle JDBC Driver][Oracle]ORA-28001: the password has expired
 
The error occurred in C:/inetpub/wwwroot/eAPS/ChangePasswordAction.cfm: line 18
16 :  <cfelse>
17 : 	<cfquery name="changepassword" datasource="#datasource#" Username="#Form.login#" password="#Form.Password#">
18 : 	ALTER USER <cfqueryparam cfsqltype="VARCHAR"  value="#FORM.LOGIN#"> IDENTIFIED BY <cfqueryparam cfsqltype="VARCHAR"  value="#LCase(FORM.VERIFYPASSWORD)#">
19 : 	</cfquery>
20 : 	<script>
 
 
Resources:

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 13, 2019 0
Adobe Community Professional ,
Nov 13, 2019

Copy link to clipboard

Copied

There is no ColdFusion error, so we're on to a good start. Check out the suggestions in https://stackoverflow.com/questions/40581131/ora-28001-the-password-has-expired

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 13, 2019 0
Explorer ,
Nov 14, 2019

Copy link to clipboard

Copied

Hi bkbk,

  Thanks for your help, we have decided to use LDAP for authentication, so basically since the previous approach was not working, we would like to do the authentication suing LDAP instead of using Oracle usernames. Will this be possible , if yes then how can we do it , please advice ?

 

Thanks

IQ

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 14, 2019 0
Adobe Community Professional ,
Nov 14, 2019

Copy link to clipboard

Copied

Hi iq11, yes LDAP is possible. We in fact use it. But that is a new question.

 

Please close this thread as answered, and start a new thread with your LDAP question. In so doing, you will help others who come to the forum looking for a solution. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 14, 2019 1
iq11 LATEST
Explorer ,
Nov 17, 2019

Copy link to clipboard

Copied

I have opened another thread shown below in the link , for the LDAP issue

https://community.adobe.com/t5/coldfusion/how-to-use-ldap-to-authenticate/m-p/10745228

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 17, 2019 0