Re: Using login alias in Membership Provider
- From: "Stephen Walch" <swalch@xxxxxxxxxxxxx>
- Date: Fri, 27 Oct 2006 16:46:42 -0400
This is a great idea and seems like it would work if I were writing the
ASP.NET app, but I am just writing the provider. Can I reasonably expect
other apps to do this? In particular, will SharePoint 2007 apply this
logic?
"Dominick Baier" <dbaier@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:4580be63199eb8c8c813b4c2f93f@xxxxxxxxxxxxxxxxxxxxx
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.
.
- Follow-Ups:
- Re: Using login alias in Membership Provider
- From: Dominick Baier
- Re: Using login alias in Membership Provider
- References:
- Re: Using login alias in Membership Provider
- From: Stephen Walch
- Re: Using login alias in Membership Provider
- From: Dominick Baier
- Re: Using login alias in Membership Provider
- Prev by Date: Re: Using login alias in Membership Provider
- Next by Date: Re: Using login alias in Membership Provider
- Previous by thread: Re: Using login alias in Membership Provider
- Next by thread: Re: Using login alias in Membership Provider
- Index(es):
Relevant Pages
|