Discussion:
Custom Membership Provider in CS2007 causes error on page load
(too old to reply)
Dave Marini
2006-07-03 18:09:02 UTC
Permalink
We have a custom Membership Provider that we want to use with our Commerce
Site. I plugged this into the CSharpSite web config and enabled the
userProfile config section to use a custom ProfileDefinition that we created
to look at our schema rather than CS2007's default User Profile Schema. The
problem I'm having is that the CS2007 PreProcessHandler errors out and I'm
assuming it's because there isn't any value in
HttpContext.User.Identity.Name. I want my users to login and THEN have
CS2007 retrieve the profiles. We don't allow anonymous users in our store.
is there any way to make this work like this? or will I have to use
ProfileContext and load the custom Profile Definition everytime I want to use
it?

Thanks,

Dave
David Hargis [MSFT]
2006-08-24 18:31:30 UTC
Permalink
You should be able to accomplish the behavior you are looking for by
manually setting CommerceContext.Current.UserID after your custom
Membership Provider is used to log in the user. Just be sure that the
login ID used by your custom membership provider is the configured as the
userIdKey in web.config.

I'm not sure what this PreProcessHandler error is, but having no
HttpContext.Current.User.Identity set should not cause errors from CS07.
But you could try changing the userIdSource web.config attribute to "UPM".
This will bypass any checks for HttpContext.Current.User.Identity.

- David

--------------------
Thread-Topic: Custom Membership Provider in CS2007 causes error on page load
thread-index: Acaey8NkV1iQgUbTSOeHUZsWd9yAvw==
X-WBNR-Posting-Host: 155.37.194.35
From: =?Utf-8?B?RGF2ZSBNYXJpbmk=?= <Dave ***@discussions.microsoft.com>
Subject: Custom Membership Provider in CS2007 causes error on page load
Date: Mon, 3 Jul 2006 11:09:02 -0700
Lines: 15
Message-ID: <62A7CEE3-58FC-4614-B287-***@microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
Newsgroups: microsoft.public.commerceserver.userprofilemgt
Path: TK2MSFTNGXA01.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.commerceserver.userprofilemgt:3590
NNTP-Posting-Host: TK2MSFTNGXA01.phx.gbl 10.40.2.250
X-Tomcat-NG: microsoft.public.commerceserver.userprofilemgt

We have a custom Membership Provider that we want to use with our Commerce
Site. I plugged this into the CSharpSite web config and enabled the
userProfile config section to use a custom ProfileDefinition that we
created
to look at our schema rather than CS2007's default User Profile Schema.
The
problem I'm having is that the CS2007 PreProcessHandler errors out and I'm
assuming it's because there isn't any value in
HttpContext.User.Identity.Name. I want my users to login and THEN have
CS2007 retrieve the profiles. We don't allow anonymous users in our store.

is there any way to make this work like this? or will I have to use
ProfileContext and load the custom Profile Definition everytime I want to
use
it?

Thanks,

Dave
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
Loading...