Re: Using login alias in Membership Provider



What you can do is to set the cookie manually, e.g.

if (Membership.ValidateUser(shortname, password)

MembershipUser user = Membership.GetUser(shortname)
FormsAuthentication.RedirectFromLoginPage(user.Username)

or with the Login control (control is called _login):

protected void _login_Authenticate(object sender, AuthenticateEventArgs e)
{
if (Membership.ValidateUser(_login.UserName, _login.Password)
{
MembershipUser user = Membership.GetUser(_login.UserName);

_login.UserName = user.UserName;
e.Authenticated = true;
}
}


---
Dominick Baier, DevelopMentor
http://www.leastprivilege.com

No, I am implementing my own membership provider for a fifferent
directory. Here again is my original questtion:

In implementing an ASP.NET Membership Provider, we can not figure out
how to supply the real user name (used in access control settings,
etc.) when users log in using just the short name.

"Steven Cheng[MSFT]" <stcheng@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:yPDPR6b%23GHA.4432@xxxxxxxxxxxxxxxxxxxxxxxx

Thanks for your reply Stephen,

So are you using the AD membership provider currently? If so, AD
membership
provider only allow us to authenticate user in a single format only.
If
you're not authenticate user through AD membership provider, are you
using
custom provider or a extended membership provider derived from AD
memberhip
provider? As you said that
"Users have only one name ("John Smith/Acme") and that is the only
name that is ever used in access control lists, role membership
lists, etc."

Then, you should always use this name as the username to validate
through membership provider. In other words, you can not make the
membership provider know both "John Smith/Acme" and
"jsmith@xxxxxxxx", you must determine which schema to use. At least
the current built-in ActiveDirectory membership provider require
this.

Also, as for the ACL(Access Control List) you mentioned, are they
normal NTFS file ACL or AD object ACL? How will you use them in your
application?

If convenient, you can provide the membership & role manager specific
configuration in your application's web.config so that we can get a
clear view of it.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no
rights.



.



Relevant Pages

  • Re: ASP.NET 2: Membership/RoleMangement vs. ASP.NET 1.1.. question
    ... I guess in this case you will have to build your own membership provider ... > own SQL Server/Access database. ... > herein lies the problem -- if i am to use ASP.NET 2's Authentication ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Membership Provider
    ... Steven Cheng ... Microsoft Online Support ... | Subject: Re: Membership Provider ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: MemberShip Question
    ... As for the Membership Provider setting, we can override it in our web ... has predefined the default membership provider as SqlMembershipProvider, ... This posting is provided "AS IS" with no warranties, and confers no rights. ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Extending MembershipUser
    ... As for the custom membership provider problem, from the description, I ... class's declaration in source file and how you config it in web.cofig to us ...
    (microsoft.public.dotnet.framework.aspnet)
  • there, Ronnie never gains until Founasse contemplates the silent citizen lazily
    ... Plenty of favourable punishments next to the psychological ... membership were contemplating onto the legislative workstation. ... Will you control out of the heaven, ... vans print except for the continuing plane. ...
    (sci.crypt)