Password recovery widget error after upgrade to 5.1 SP1

Posted by Community Admin on 04-Aug-2018 08:25

Password recovery widget error after upgrade to 5.1 SP1

All Replies

Posted by Community Admin on 04-Aug-2012 00:00

Our password recovery widget results in error after upgrading from 5.0 to 5.1SP1.
This is our template (PasswordRecovery.ascx):

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PasswordRecovery.ascx.cs" Inherits="SitefinityWebApp.Widgets5.PasswordRecovery" %>
<%@ Register TagPrefix="sf" Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Security.Web.UI" %>
 
<style type="text/css">
.sfFailure
    color: Red;
.sfTxtLbl
    clear: left;
    float: left;
    margin: 0 0 0 0;
.sfValidator
    clear: left;
    float: left;
    color: Red;
.sfSave
    background-color: transparent;
    cursor: pointer;
    width: 78px;
    height: 30px;
    margin: 15px 0 15px 10px;
.sfLinkBtnIn
    line-height: 30px;
    height: 30px;
strong.sfLinkBtnIn
    background: url(<%= ResolveUrl("~/App_Themes") %>/Default/Images/sfButton_Right.png) top right no-repeat;
    color: Black;
a.sfSave:hover strong
    color: Gray !important;
    text-decoration: none;
.sfLinkBtn
    clear: both;
    padding-left:1px;
    font-size:11px;
    display: block;
    width:auto;
    float:left;
    text-decoration:none;
    margin-left: 30px;
.sfLinkBtnIn
    padding-right:25px;
    display:block;
    height:30px;
    width:auto;
    float: left;
    line-height: 26px;
    color: #000;
    border:0;
    padding: 0 25px 0 10px;
    font-size: 12px;
    font-family:arial;
    font-weight: bold;
    cursor: hand;
.cancelDiv
    margin: 30px 0 0 0;
.liStyle
    list-style-type: none;
.sfFormList .liStyle li
    list-style-type: none;
.sfTxtLbl
    clear: both;
    margin: 0 0 0 0;
    padding: 2px 0 0 0;
</style>
 
<sf:PasswordRecoveryForm ID="PasswordRecoveryForm1" runat="server" AllowSelectMembershipProvider="false" MembershipProvider="OpenAccessMembership37Provider" ValidationGroup="ValidatePasswordRecovery1" CancelDestinationPageUrl="~/" ContinueDestinationPageUrl="~/Community/UserLogin.aspx">
<MailDefinition From="myworkingemail@mycompany.com" Subject="<%$ Resources:Main, PassRecovery_MailSubject %>" BodyFileName="<%$ Resources:Main, PassRecovery_MailBody %>" IsBodyHtml="true" />
 
    <UserNameTemplate>
         
        <h3><asp:Label ID="lblForgotYourPassword" runat="server" Text="<%$ Resources:Main, ForgotYourPassword %>" /></h3>
         
        <asp:Label ID="FailureText" runat="server" EnableViewState="False" CssClass="sfFailure" />
 
 
        <fieldset style="padding: 10px 10px 10px 10px;">
            <p><asp:Label ID="lblEnterUN" runat="server" Text="<%$ Resources:Main, EnterYourUserName %>" /></p>
            <ol class="sfFormList">
                <li id="ProvidersHolder" runat="server" class="liStyle">
                    <asp:Label ID="Label4" Text="<%$ Resources:Labels, Provider %>" AssociatedControlID="ProvidersList" runat="server" CssClass="sfTxtLbl" />
                    <asp:DropDownList ID="ProvidersList" AutoPostBack="false" AccessKey="l" runat="server" />
                </li>
                <li class="liStyle">
                    <asp:Label ID="lblUname1" runat="server" Text="<%$ Resources:Main, Username %>" CssClass="sfTxtLbl" />: 
                    <asp:TextBox ID="UserName" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                    ErrorMessage="<%$ Resources:Main, UserNameIsRequired %>" ToolTip="<%$ Resources:Main, UserNameIsRequired %>"
                    ValidationGroup="ValidatePasswordRecovery1" CssClass="sfValidator"></asp:RequiredFieldValidator>
                </li>
                <li class="liStyle">
                     <br />
                    <telerik:RadCaptcha ID="radCaptcha" runat="server" 
                        ValidationGroup="ValidatePasswordRecovery1" ProtectionMode="Captcha"
                        ErrorMessage="<%$ Resources:Main, CaptchaErrorMessage %>"
                        CaptchaTextBoxLabel="<%$ Resources:Main, CaptchaTextBoxLabel %>"></telerik:RadCaptcha>
                     
                </li>
            </ol>
            <p class="sfSubmitBtn sfMainFormBtns">
                <asp:ImageButton ID="SubmitButton" runat="server" ValidationGroup="ValidatePasswordRecovery1"
                ImageUrl="~/App_Themes/Default/Images/LoginButton_en.png" CssClass="sfLinkBtn sfSave" ToolTip="<%$ Resources:Main, Submit %>" />
                 
                <div id="divCancel" class="cancelDiv">
                       
                    <asp:Label ID="lblOr" runat="server" Text="<%$ Resources:Labels, Or %>" />
                      
                    <asp:LinkButton ID="CancelButton" runat="server" CausesValidation="False"
                         CommandName="Cancel" Text="<%$ Resources:Labels, Cancel %>" class="sfCancel" />
                </div>
                <!-- do not remove this button. It is used for the default form submit (pressing enter) -->
                <span style="display:none;">
                    <asp:Button ID="hiddenSubmitButton" runat="server" />
                </span>
            </p>
        </fieldset>
     
    </UserNameTemplate>
</sf:PasswordRecoveryForm>

The error we get is:
Server Error in '/G6PD51' Application.
--------------------------------------------------------------------------------
 
There is no configuration for data provider with the name of "OPENACCESSMEMBERSHIP37PROVIDER,OPENACCESSMEMBERSHIP37PROVIDER,OPENACCESSMEMBERSHIP37PROVIDER" for "Telerik.Sitefinity.Security.UserManager" manager. Please check the spelling of the name and whether such configuration exists.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
 
Exception Details: Telerik.Sitefinity.Data.MissingProviderConfigurationException: There is no configuration for data provider with the name of "OPENACCESSMEMBERSHIP37PROVIDER,OPENACCESSMEMBERSHIP37PROVIDER,OPENACCESSMEMBERSHIP37PROVIDER" for "Telerik.Sitefinity.Security.UserManager" manager. Please check the spelling of the name and whether such configuration exists.
 
Source Error:
 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 
 
Stack Trace:
 
 
[MissingProviderConfigurationException: There is no configuration for data provider with the name of "OPENACCESSMEMBERSHIP37PROVIDER,OPENACCESSMEMBERSHIP37PROVIDER,OPENACCESSMEMBERSHIP37PROVIDER" for "Telerik.Sitefinity.Security.UserManager" manager. Please check the spelling of the name and whether such configuration exists.]
   Telerik.Sitefinity.Data.ManagerBase`1.SetProvider(String providerName, String transactionName) +471
   Telerik.Sitefinity.Data.ManagerBase`1.GetManager(String providerName, String transactionName) +593
   Telerik.Sitefinity.Security.Web.UI.PasswordRecoveryForm.AttemptSendPasswordUserNameView() +134
   Telerik.Sitefinity.Security.Web.UI.PasswordRecoveryForm.OnBubbleEvent(Object source, EventArgs e) +86
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +52
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5492
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +742
   System.Web.UI.Page.ProcessRequest() +269
   System.Web.UI.Page.ProcessRequest(HttpContext context) +140
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +533
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +256
 
 --------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

We tried changing the widget to allow selecting a membership provider:
AllowSelectMembershipProvider="true"
And everything works fine.
The error occurs only when it is set to "false" (the way we want it and the way it worked in version 5.0).

Thanks in advance for any clue.

Posted by Community Admin on 14-Aug-2012 00:00

Just to close this issue:
We've discovered that after upgrading the Login Control we use (offering "backward compatibility") injects the Membership Provider 3 times when generating links. This causes the problem for our custom Password Reminder control.
Our Login control main settings are:
- AllowSelectMembershipProvider: False
- CreateUserUrl: ~/Register.aspx
- DestinationPageUrl: ~/
- LayoutTemplatePath: ~/SFRes/Telerik.Sitefinity.Resources.Templates.PublicControls.LoginControl.ascx
- MembershipProvider: OpenAccessMembership37Provider
- PasswordChangeUrl: ~/Sitefinity/Login/ChangePassword.aspx
- PasswordRecoveryUrl: ~/PasswordReminder.aspx

Now, the url produced by the login control for all links (register, password reminder) is something as follows:

http://localhost:32154/Site/PasswordReminder.aspx?provider=OpenAccessMembership37Provider&provider=OpenAccessMembership37Provider&provider=OpenAccessMembership37Provider:32154/Site/PasswordReminder.aspx?provider=OpenAccessMembership37Provider&provider=OpenAccessMembership37Provider&provider=OpenAccessMembership37Provider

In other words, the upgraded application produces the long querystring where the provider is repeated 3 times.
I've tried using our custom Password Reminder control without this unwanted and unnecessary querystring, and it works fine.
I've tried using this control with a SINGLE parameter (provider=OpenAccessMembership37Provider) and it works.
Trying with the generated querystring (with the provider parameter repeated 3 times) the control does not work.

As a workaround, I've added this in the control's Page_Load:
if (Request.Url.Query.Length > 0)
Response.Redirect(Request.Url.AbsolutePath.ToString());

This works, but it would be most interesting to understand why the querystring is being added automatically to the link?
 

This thread is closed