<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Login Principal</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2009 : Login Principal</description>
  <pubDate>Tue, 28 Apr 2026 03:41:37 -700</pubDate>
  <lastBuildDate>Tue, 24 Mar 2009 15:49:56 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=1167</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Login Principal : Mark, I can&amp;#039;t reproduce this...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1167&amp;PID=4171#4171</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 1167<br /><strong>Posted:</strong> 24-Mar-2009 at 3:49pm<br /><br /><P>Mark, I can't reproduce this behavior using&nbsp;a simple WinForms or console application.&nbsp; Is this an ASP.NET or Windows Service application?&nbsp; Do you have multiple DataSourceKeyResolvers?&nbsp; Is the LoginManager using (and logging in to) an EntityManager?</P>]]>
   </description>
   <pubDate>Tue, 24 Mar 2009 15:49:56 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1167&amp;PID=4171#4171</guid>
  </item> 
  <item>
   <title>Login Principal : Thanks Kim!  </title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1167&amp;PID=4170#4170</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=449" rel="nofollow">smi-mark</a><br /><strong>Subject:</strong> 1167<br /><strong>Posted:</strong> 24-Mar-2009 at 12:13pm<br /><br />Thanks Kim!]]>
   </description>
   <pubDate>Tue, 24 Mar 2009 12:13:25 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1167&amp;PID=4170#4170</guid>
  </item> 
  <item>
   <title>Login Principal : That is interesting. I don&amp;#039;t...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1167&amp;PID=4169#4169</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 1167<br /><strong>Posted:</strong> 24-Mar-2009 at 11:47am<br /><br />That is interesting.&nbsp; I don't have an explanation for the credentials used in the "client-side" FindKey and will need to test it out to see what's going on.&nbsp; I'll let you know.<DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Tue, 24 Mar 2009 11:47:21 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1167&amp;PID=4169#4169</guid>
  </item> 
  <item>
   <title>Login Principal : No, this is not using a BOS. LoginManagerCredential...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1167&amp;PID=4168#4168</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=449" rel="nofollow">smi-mark</a><br /><strong>Subject:</strong> 1167<br /><strong>Posted:</strong> 24-Mar-2009 at 11:40am<br /><br />No, this is not using a BOS. <br><br>LoginManagerCredential Implements ILoginCredential and UserPrincipal implements IPrincipal. I have tried setting them both to Serializable and implementing IKnownType. <br><br>This is interesting though: ( I cut out some parts to improve readability)<br><br>username="Mark-Laptop\Mark" &gt;Probed for 'IDataSourceKeyResolver' and found LoginManagerDataSourceKeyResolver<br>username="Mark-Laptop\Mark" Probed for 'IEntityLoginManager' and found LoginManager<br>username="sa"&gt;Logged in as sa, CurrentPrincipal Type: UserPrincipal<br>username="Mark-Laptop\Mark" source="DataSourceResolver:FindKey"&gt;Resolving key DEFAULT, On Server: <b>False</b>, CurrentPrincipal Type: <b>WindowsPrincipal</b><br>username="sa" source="DataSourceResolver:FindKey"&gt;Resolving key DEFAULT, On Server: <b>True,</b> CurrentPrincipal Type: <b>UserPrincipal</b><br>username="sa" source="DataSourceResolver:GetKeyRelatedInfo"&gt;Probed for 'IIdentityIdGenerator' and found StoreGeneratedIdGenerator<br><br><br>]]>
   </description>
   <pubDate>Tue, 24 Mar 2009 11:40:05 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1167&amp;PID=4168#4168</guid>
  </item> 
  <item>
   <title>Login Principal : EntityManager.DefaultManager will...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1167&amp;PID=4167#4167</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 1167<br /><strong>Posted:</strong> 24-Mar-2009 at 11:04am<br /><br />EntityManager.DefaultManager will point to the first EntityManager constructed, or construct a new one.&nbsp; If the DefaultManager and the EntityManager you've logged in with are not the same, then I suppose it's possibly part of the problem.<DIV>&nbsp;</DIV><DIV>Are you using a BOS?&nbsp; Does your custom principal inherit from WindowsPrincipal?&nbsp; There could be a serialization problem of this data back to the client, with the client receiving the base type instead of your custom type.</DIV>]]>
   </description>
   <pubDate>Tue, 24 Mar 2009 11:04:04 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1167&amp;PID=4167#4167</guid>
  </item> 
  <item>
   <title>Login Principal : No, this is all being done in...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1167&amp;PID=4166#4166</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=449" rel="nofollow">smi-mark</a><br /><strong>Subject:</strong> 1167<br /><strong>Posted:</strong> 24-Mar-2009 at 10:52am<br /><br />No, this is all being done in a single thread. Would using EntityManager.DefaultManager be causing any problems ?&nbsp;]]>
   </description>
   <pubDate>Tue, 24 Mar 2009 10:52:05 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1167&amp;PID=4166#4166</guid>
  </item> 
  <item>
   <title>Login Principal : Is it a multi-threaded application?...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1167&amp;PID=4165#4165</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 1167<br /><strong>Posted:</strong> 24-Mar-2009 at 10:35am<br /><br />Is it a multi-threaded application?&nbsp; The Login will set the principal on only the current&nbsp;thread, so any other threads, even ones where an EntityManager was created via the copy constructor, will not be touched by DevForce.&nbsp; Also, when DevForce defaults&nbsp;the CurrentPrincipal after an implicit login, it's always a GenericPrincipal/GenericIdentity and never a WindowsPrincipal.<DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Tue, 24 Mar 2009 10:35:51 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1167&amp;PID=4165#4165</guid>
  </item> 
  <item>
   <title>Login Principal : Thanks for the quick response...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1167&amp;PID=4164#4164</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=449" rel="nofollow">smi-mark</a><br /><strong>Subject:</strong> 1167<br /><strong>Posted:</strong> 24-Mar-2009 at 10:26am<br /><br />Thanks for the quick response Kim. This is on the client. In my LoginManager I'm setting the principal manually but also returning the principal so that shouldn't cause any issues. It's somewhere in between from when Login is called and before GetKey. I have also checked the DebugLog and it is indeed resolving the correct IEntityLoginManager and IDataSourceKeyResolver interfaces. It seems like it is defaulting back to the default windows user even after the login call. Is there any more info I can get that might help?<br><br>Thanks,<br><br>mark<br>]]>
   </description>
   <pubDate>Tue, 24 Mar 2009 10:26:15 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1167&amp;PID=4164#4164</guid>
  </item> 
  <item>
   <title>Login Principal : On the client, when a Login()...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1167&amp;PID=4162#4162</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 1167<br /><strong>Posted:</strong> 24-Mar-2009 at 10:17am<br /><br /><P>On the client, when a Login() completes, DevForce will set the Thread.CurrentPrincipal to whatever was returned from the IEntityLoginManager.Login.&nbsp; On the server, that same principal is used to set the Thread.CurrentPrincipal before a fetch or save.</P><P>Are you seeing the problem when the IDataSourceKeyResolver.GetKey is called on the client or on the server?&nbsp; If on the server, presumably GetKey is called within the context of a fetch or save (I'd have to double check), but if not, maybe it's defaulted to the process current user.</P><P>&nbsp;</P>]]>
   </description>
   <pubDate>Tue, 24 Mar 2009 10:17:19 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1167&amp;PID=4162#4162</guid>
  </item> 
  <item>
   <title>Login Principal : Hi,We are having some problems...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1167&amp;PID=4161#4161</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=449" rel="nofollow">smi-mark</a><br /><strong>Subject:</strong> 1167<br /><strong>Posted:</strong> 24-Mar-2009 at 9:11am<br /><br />Hi,<br><br>We are having some problems with the LoginManager in EF, for some reason the Thread.CurrentPrincipal is being reset to a WindowsPrincipal instead of our custom principal in between the IEntityLoginManager.Login and the IDataSourceKeyResolver.GetKey call.<br><br>In the login function I set the Principal like so:<br>Thread.CurrentPrincipal = aUserPrincipal<br>debugging shows it has set correctly.<br><br>When it hits the DataSourceKeyResolver I get the principal using "Dim aPrincipal As IPrincipal = Thread.CurrentPrincipal" it now shows up as a windows principal/identity. Is there a reason why this is happening?<br><br>Thanks,<br><br>Mark<br>]]>
   </description>
   <pubDate>Tue, 24 Mar 2009 09:11:25 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1167&amp;PID=4161#4161</guid>
  </item> 
 </channel>
</rss>