Re: web.config credentials section - original reply
- From: "gerry" <germ2@xxxxxxxxxxxxxxxx>
- Date: Mon, 11 May 2009 07:17:29 -0400
From: "gerry" <germ2@xxxxxxxxxxxxxxxx>
Newsgroups: microsoft.public.dotnet.framework.aspnet
References: <OWY8DLPzJHA.2324@xxxxxxxxxxxxxxxxxxxx>
<Rt9DyDTzJHA.2064@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: web.config credentials section
Date: Tue, 5 May 2009 09:32:20 -0400
Lines: 90
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
Thanks Allen,
that works - sort of.
Since there doesn't appear to be a WebConfigMembershipProvider, and the
default membership provider ( or any membership provider for that matter )
is not smart enough to recognize that the credentials section is present and
use it, I have to ask - why is the credentials section in the web.config at
all ?
If we have to special case everything dealing with users & authentication to
use it - doesn't that defeat the whole point in the provider framework ?
ie. this no longer works :
protected void Login1_LoggedIn( object sender , EventArgs e )
{
MembershipUser User2 = Membership.GetUser(); // User2 is
always null
}
I think I will take a few minutes and create a WebConfigMembershipProvider
just for kicks.
Gerry
"Allen Chen [MSFT]" <allenc@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:Rt9DyDTzJHA.2064@xxxxxxxxxxxxxxxxxxxxxxxxx
Hi Gerry,
The cause of this problem is, the Login control doesn't call
FormsAuthentication.Authenticate API to authenticate. Instead, it let the
MembershipProvider to validate user, which by default is
SqlMembershipProvider.
If you want to test the credentials you can try this:
<asp:Login ID="Login1" runat="server" onloggingin="Login1_LoggingIn">
</asp:Login>
protected void Login1_LoggingIn(object sender, LoginCancelEventArgs e)
{
string username= this.Login1.UserName;
string password= this.Login1.Password;
bool isvaliduser= FormsAuthentication.Authenticate(username,
password);
if (isvaliduser)
{
FormsAuthentication.RedirectFromLoginPage(username,
this.Login1.RememberMeSet);
}
}
Please test the above code and let me know if it works.
Regards,
Allen Chen
Microsoft Online Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxxxxxxxxxx
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support
Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.
.
- Follow-Ups:
- Re: web.config credentials section - original reply
- From: Allen Chen [MSFT]
- Re: web.config credentials section - original reply
- From: Allen Chen [MSFT]
- Re: web.config credentials section - original reply
- References:
- RE: web.config credentials section
- From: Allen Chen [MSFT]
- RE: web.config credentials section
- Prev by Date: Re: web.config credentials section
- Next by Date: Re: aspcompat performance problem
- Previous by thread: Re: web.config credentials section
- Next by thread: Re: web.config credentials section - original reply
- Index(es):
Relevant Pages
|