Security :: Setting SMTP Failure Text For PasswordRecovery?
Jul 20, 2010
Is there any easy way of setting a failure text within the PasswordRecovery control?
I want to be able to notify users that there was a problem with sending an email. Is there a failure - counterpart to the SuccessTemplate i can use or is there any other template/control within the passwordRecovery control whose value can be set in a handler to the onsendmailerror event?
(Please don't send MSDN links to PasswordRecovery or onsendmailerror, i've read them)
My PasswordRecovery Control is not working. It is giving me SMTP problem. I set my proper gmail address with port number, valid user name and password. But not working? Do I require to set more settings?
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. pg3sm5232120pbc.2
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Net.Mail;
Firstly, I'm a newbie to ASP.net, but have around ten years of ('classic') ASP and VB6 experience.I have spent the last 12 hours or so googling for a solution to this problem, so it's nothing obvious (to myself or anyone else I can find talking about it, at least). Things I have ruled out so far include:1) Lack of SMTP server (fixed)2) Firewall issues3) Web.config <mailsettings> directivesI am developing my app locally (VS-2010, Windows 7 Premium ). When I kick off my application containing a form with the PasswordRecovery control in it, and run the password recovery control, I get the error:
[Code]....
This I figured is because I am running Windows 7, which doesn't have IIS7.5 (and thus an SMTP server) running by default. So I enabled IIS 7.5 in component settings, and lo and behold there it was. However there was no SMTP server included (those kind folk at Microsoft like to randomly remove things in system upgrades).So I dug around and installed a free smtp mailserver "hMailServer", and set it up with a the relay mail server address I use with my O2 email, with default credentials.I ran the test and it confirmed that I was indeed reaching the server OK. It also said I could therefore reference Localhost as my smtp server.I also realised I was missing the web.config <mailsettings> directives, so included (under <system.net> <mailsettings>):
<smtp deliveryMethod="Network" from ="zenid@here.com"> <network host="localhost" defaultCredentials="true" port="20" /> </smtp>
I'm using asp.net's built-in membership provider with security question-and-answer enabled for password recovery against a SQL Server 2005 db. For some users, this works fine and they're able to receive their passwords. For others, and it's not clear what separates the two groups, the security answer is never properly processed. It doesn't matter if the answer is correct or incorrect, the page merely reloads without confirming or denying the request.As for events, VerifyingAnswer is being triggered, but not AnswerLookupError (if answer is incorrect) or SendingMail (if answer is correct). I ran a SQL trace during one instance, and the aspnet_Membership_GetUserByName stored procedure is being called, but nothing else gets called after. I would expect that aspnet_Membership_GetPassword would be called, which passes the security answer as a parameter, but it isn't.
I am adding a 2nd web site to our pubic server and am noticing the SMTP delivery trying to use the default SMTP Virtual Server which is set up for the 1st web.
I created a 2nd virtual server with new smart host and credentials for the new site but need to modify the config file.
I tried using the host name = smtp virtual server 2 name.
I have asked the following question multiple times but did not receive any proper reply.
I have a web page which is using PasswordRecovery control.
Its working fine but I have a scenario in which I have to disable Viewstate for the whole application.
Now after disabling viewstate when I visit the webpage I have noticed that PasswordRecovery controls is not working (Every times when I submit the default button to go to step 2, the postback occur but not moving to step 2).
I am trying to send an email using the gmail smtp server. I am trying to enter the SMTP settings into the Web Site Admin tool. I have set
Server Name: smtp.gmail.com server port: 587 from: myemail@gmail.com
Sender's User Name: my real gmail username Sender's Password: my real gmail password
I am getting the following error when I try to send an email as a result on using the CreateUserWizard after successfully creating a new user.
Code:
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. i29sm30127820vcr.12
I have a PasswordRecovery control set up on an ascx control as shown below. In some cases users have gotten two emails with different passwords sent at the same time. They're insistent that they haven't hit the button twice. I am using the CSSFriendly adapters, so I can take that off and see if it corrects the problem. Otherwise I suppose I could put this on the aspx page rather than a control.
I am new to asp.net 4.0 and I am having a hard time changing the PasswordRecovery to email instead of username. here is my aspx page (the page won't hit the vb code unless i enter the username not the email)
I'm customizing the look and feel of the PasswordRecovery control. The problem is this. I've already set the "Search" button on my site as the default button. I've noticed that all the buttons used in customizing PasswordRecovery use "Button" as their IDs. So in my Page_Load() event, I tried this.Form.DefaultButton = pr1.FindControl("Button").UniqueID; where pr1 is the PasswordRecovery control. But I keep getting "Object reference not set to an instance of an object" error where I try to set Button as the default button.How do I make sure that the user can actually hit "Enter" to use PasswordRecovery as opposed to having to click the buttons?
I have an app that uses impersonation to gain access to a database (on server separate from IIS). The app connects to the database using a trusted connection and seems to be working just fine. However, we get these logon failure events in the security event viewer:
[Code]....
It must have something to do with impersonation because the login failure is for the domain account which my app is impersonating under. But again, the app is working fine so I'm having a hard time figuring out how to stop these logon failures.
how to make this work (I assume that no code behind is needed to make this work in its simplest form?).After user correctly answers the security question and presses submit, no email is sent. No message is displayed. Nothing. What is missing?
For reasons to long to go in to I have to change the behaviour/appearance of the Success page on our password recovery page.
We've been tasked with making the Success template identical to the UserName template i.e. with a label and text box for UserName and identical messages on both pages.
Basically our client wants no difference between successful password retireval and failure - the same message will display regardless e.g. "An email has been sent to <username> with your password."
Which reminds me - in the success/failure message they'd like the entered UserName to appear but I can only get it to appear if it's a valid username - if it's nonsense the UserName is blank.
After entering username and keying enter key(from keyboard) it was not firing submitbutton_click event. So i have added defaultbutton property in the panel control, and it is working fine. And my problem here is..
Clicking on submit button it is showing security question. After answering the security question, i have to click on the submit button either by mouse click or tab enter.
What i need to do is.. after answering the security question, I should be able to hit enter key instead of mouse clicking on submit button.
I have a web page which is using PasswordRecovery control.
But I have a scenario in which I have to disable Viewstate for the whole application.
Now after disabling viewstate when I visit the webpage I have noticed that PasswordRecovery controls is not working (Every times when I submit the default button to go to step 2, the postback occur but not moving to step 2).
Is it possible to use the PasswordRecovery control to recover a password using the email address instead of the user name?
Ideally I'd like to have the PasswordRecovery control allow users to enter their email address instead of their user name and then proceed to answer the security question.
I am using asp login control on my aspx page. and for different conditions, i need to show different failure messages. so , I am resetting FailureText property in code behind.
but, the control does not show failure message for any condition.
I have converted this login control to template for design purpose.
i am trying to create a strong name for assembly.....by giving the below code----
assembly: AssemblyDelaySign(false)] assembly: AssemblyKeyFile(@"UsersABCDocumentsVisual Studio 2008ProjectscodeaccesssecuritycodeaccesssecurityinDebugABC.snk")] assembly: AssemblyKeyName("")]
when i am compiling project i am getting this error........
Error 1 Cryptographic failure while signing assembly 'C:UsersABCDocumentsVisual Studio 2008ProjectscodeaccesssecuritycodeaccesssecurityobjReleasecodeaccesssecurity.exe' -- 'Error reading key file 'UsersABCDocumentsVisual Studio 2008ProjectscodeaccesssecuritycodeaccesssecurityinDebugABC.snk' -- The system cannot find the path specified. '
Here's the situation. I have an aspx page that is designed to receive a POST request with some XML values, parse the XML, grab the relevant items, and write them to the page. The problem arises when I try to launch the page using the POST request. When I launch using Fiddler, building the request manually and just pasting the XML in the body of the request everything works fine and dandy. When I launch the page from a basic HTML form, however, things don't go so great. The HTML form that I'm using looks like this:
[Code]....
When the page loads I get the error:
A potentially dangerous Request.Form value was detected from the client Everything I've read so far has told me that the solution is to add ValidateRequest="false" to the page directive in the top of the .aspx file, or in the pages element of the web.config file. But neither of these work. Afterwards, I still get the same error. Any idea what I need to do to make this work?
I've got a site called domain.com and also another product on product.domain.com. The product.domain.com requires authentication to access it. For consistancy in the user experience I have set the login url in the web.config on product.domain.com to be http://domain.com/Login.aspx. This redirection is working ok - and a sample url would be:
The problem is that the RedirectURL does not take into account that the request originally came from product.domain.com so when the authentication is successful the user is not redirected back to product.domain.com
I have come up with a solution for this but would like feedback if possible.
I changed the loginURL in the web.config to http://domain.com/Login.aspx?domain=product.domain.com so the sample url is now:
I then override the LoggedIn event in the membership control and check to see if the domain value pair is specified and if it is I redirect to the domain + ReturnURL.
As I said previously i'd appreciate any comments or other ways to achieve the same result.