Re: web.config credentials section - original reply

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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.




.



Relevant Pages

  • Re: Using login alias in Membership Provider
    ... I think the Display name is an additional ... field to the built-in membership provider, ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • RE: LOGON32_LOGON_NEW_CREDENTIALS and GetTokenInformation
    ... The groups would not be calculated until an actual authentication were ... LOGON32_LOGON_NEW_CREDENTIALS, it's not even known whether the credentials ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.platformsdk.security)
  • Re: Multiple Authentication Providers in One Site?
    ... A WSS 3.0 site can only use a Membership provider at same time, ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.sharepoint.windowsservices)
  • RE: WindowsIdentity, Memebrship/Role, or ???
    ... Yes, Kerberos and NTLM must mean Windows authentication for this, and also ... For get membership provider for FORM authentication, ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: And yet more shiao jiao clips
    ... evidence that said credentials either don't exist or are forged. ... Mike is using to support his position. ... "another scholar in the field." ...
    (rec.martial-arts)