<?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 : How to use DevForce entities in authentication</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : How to use DevForce entities in authentication</description>
  <pubDate>Wed, 13 May 2026 09:42:02 -700</pubDate>
  <lastBuildDate>Wed, 29 Feb 2012 08:56:11 -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=3272</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>How to use DevForce entities in authentication :   This is why memebership provider...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3272&amp;PID=12858#12858</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1264" rel="nofollow">katit</a><br /><strong>Subject:</strong> 3272<br /><strong>Posted:</strong> 29-Feb-2012 at 8:56am<br /><br />This is why memebership provider not good.<div>&nbsp;</div><div>Don't use it like this if you want to use DevForce for data access.</div><div>&nbsp;</div><div>You can simply say </div><div>var myEntityManager = new AppEntityManager();</div><div>myEntityManager.Login();</div><div>&nbsp;</div><div>And than inspect how that went. </div><div>&nbsp;</div><div>Basically, if you ARE using DevForce for data access - start with EntityManager everywhere.</div><div>&nbsp;</div><div>&nbsp;</div>]]>
   </description>
   <pubDate>Wed, 29 Feb 2012 08:56:11 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3272&amp;PID=12858#12858</guid>
  </item> 
  <item>
   <title>How to use DevForce entities in authentication : Well, as soon as one problem is...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3272&amp;PID=12854#12854</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1394" rel="nofollow">alexander</a><br /><strong>Subject:</strong> 3272<br /><strong>Posted:</strong> 29-Feb-2012 at 2:07am<br /><br />Well, as soon as one problem is solved, another one pops up.<br><br>When using the WCF Authentication Service, after configuring it properly, you simply make a call in the client app, like so:<br><pre style="font-family:C&#111;nsolas;font-size:13;color:black;:white;"><span style="color:blue;">if</span>(&nbsp;System.Web.Security.<span style="color:#2b91af;">Membership</span>.ValidateUser(&nbsp;<span style="color:#a31515;">"alexander"</span>,&nbsp;<span style="color:#a31515;">"password"</span>&nbsp;)&nbsp;){&nbsp;&nbsp;&nbsp;&nbsp;Content&nbsp;=&nbsp;<span style="color:#a31515;">"LOGGED&nbsp;IN"</span>;}<span style="color:blue;">else</span>{&nbsp;&nbsp;&nbsp;&nbsp;Content&nbsp;=&nbsp;<span style="color:#a31515;">"DIDN'T&nbsp;LOG&nbsp;IN"</span>;}</pre>which magically ends up calling the ValidateUser method on the MembershipProvider on the server. As you can see from my implementation above, my MembershipProvider requires the magic EntityManager that gets supplied by the IEntityLoginManager. When using the WCF Authentication Service, the IEntityLoginManager is bypassed, and the call to ValidateUser is direct, which means that my "AuthenticatedEntityManager" property is null.<br><br>Is there something I can do to acquire that "magic" EntityManager in some other way or otherwise get around the whole Entity authentication issue some other way? All these obstacles I keep running into are getting just a smidgen annoying...<br>]]>
   </description>
   <pubDate>Wed, 29 Feb 2012 02:07:28 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3272&amp;PID=12854#12854</guid>
  </item> 
  <item>
   <title>How to use DevForce entities in authentication :   In my experience MembershipProvider...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3272&amp;PID=12782#12782</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1264" rel="nofollow">katit</a><br /><strong>Subject:</strong> 3272<br /><strong>Posted:</strong> 24-Feb-2012 at 4:48am<br /><br />In my experience MembershipProvider will only take you that far. Testability - 0<div></div><div>I ended up writing my own MembershipService, but I needed some specific stuff</div>]]>
   </description>
   <pubDate>Fri, 24 Feb 2012 04:48:54 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3272&amp;PID=12782#12782</guid>
  </item> 
  <item>
   <title>How to use DevForce entities in authentication : Katit: You are correct, I ended...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3272&amp;PID=12778#12778</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1394" rel="nofollow">alexander</a><br /><strong>Subject:</strong> 3272<br /><strong>Posted:</strong> 24-Feb-2012 at 12:54am<br /><br />Katit: You are correct, I ended up having to use that magic EntityManager to get around my issue. I still wanted to use the ASP.NET security and the AspAuthenticatingLoginManager, so what I did was this:<br><br>public class MyAspAuthenticatingLoginManager : AspAuthenticatingLoginManager, IEntityLoginManager<br>{<br>&nbsp;&nbsp;&nbsp; private static void SetProviderEntityManager( EntityManager entityManager )<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MyMembershipProvider membershipProvider = Membership.Provider as MyMembershipProvider;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( membershipProvider != null )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; membershipProvider.AuthenticatedEntityManager = entityManager;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MyRoleProvider roleProvider = Roles.Provider as MyRoleProvider;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( roleProvider != null )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; roleProvider.AuthenticatedEntityManager = entityManager;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MyProfileProvider profileProvider = ProfileManager.Provider as MyProfileProvider;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( profileProvider != null )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; profileProvider.AuthenticatedEntityManager = entityManager;<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; public new IPrincipal Login( ILoginCredential credential, EntityManager entityManager )<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SetProviderEntityManager( entityManager );<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return base.Login( credential, entityManager );<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; public new void Logout( IPrincipal principal, EntityManager entityManager )<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SetProviderEntityManager( entityManager );<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; base.Logout( principal, entityManager );<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>As you can see, I'm passing the magic entityManager over to my custom ASP.NET Provider classes before I let the AspAuthenticatingLoginManager do its thing.<br>]]>
   </description>
   <pubDate>Fri, 24 Feb 2012 00:54:22 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3272&amp;PID=12778#12778</guid>
  </item> 
  <item>
   <title>How to use DevForce entities in authentication :   I think I know what is the...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3272&amp;PID=12714#12714</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1264" rel="nofollow">katit</a><br /><strong>Subject:</strong> 3272<br /><strong>Posted:</strong> 21-Feb-2012 at 11:45am<br /><br />I think I know what is the problem.. <div>&nbsp;</div><div>Alexander</div><div>&nbsp;</div><div>You need to use your custom LoginManager (inherited from IEntityLoginManager)</div><div>&nbsp;</div><div>Inside, you will implement</div><div>I<font color="#2b91af" size="2" face="C&#111;nsolas"><font color="#2b91af" size="2" face="C&#111;nsolas"><font color="#2b91af" size="2" face="C&#111;nsolas">Principal</font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"> Login(</font></font><font color="#2b91af" size="2" face="C&#111;nsolas"><font color="#2b91af" size="2" face="C&#111;nsolas"><font color="#2b91af" size="2" face="C&#111;nsolas">ILoginCredential</font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"> credential, </font></font><font color="#2b91af" size="2" face="C&#111;nsolas"><font color="#2b91af" size="2" face="C&#111;nsolas"><font color="#2b91af" size="2" face="C&#111;nsolas">EntityManager</font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"> manager)</font></font></div><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"></font></font><div>&nbsp;</div><div>&nbsp;</div><div>EntityManager that will be passed there - will be "magic" one that you can use for the data access to get permission and check access against database. Check documentation on how to write custom LoginManager</div><div>&nbsp;</div><div>In my application I also use custom SourceKeyResolver and there I _had_ to use other means to access data, not DevForce because I was getting catch 22 situation. </div><div>&nbsp;</div><div>&nbsp;</div>]]>
   </description>
   <pubDate>Tue, 21 Feb 2012 11:45:49 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3272&amp;PID=12714#12714</guid>
  </item> 
  <item>
   <title>How to use DevForce entities in authentication :   Hi Alexander,Sorry for the...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3272&amp;PID=12713#12713</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 3272<br /><strong>Posted:</strong> 21-Feb-2012 at 11:30am<br /><br />Hi Alexander,<div>&nbsp;</div><div>Sorry for the confusion.&nbsp;</div><div>&nbsp;</div><div><div><em>AllowAnonymousLogin</em> will determine if guest users can login to your application to use DevForce services such as query and save. In your scenario, since you are not logged it yet, it obviously won't allow the query.</div><div>&nbsp;</div></div><div>Can you give more details on what you are trying to do? </div><div>Why are you trying to query within your login manager? It wouldn't make sense to allow a query from a guest user there if&nbsp;<em>AllowAnonymousLogin</em> is set to <em>true</em>.</div><div>&nbsp;</div><div>Silvio.</div>]]>
   </description>
   <pubDate>Tue, 21 Feb 2012 11:30:25 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3272&amp;PID=12713#12713</guid>
  </item> 
  <item>
   <title>How to use DevForce entities in authentication :   I think you misunderstood...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3272&amp;PID=12703#12703</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1394" rel="nofollow">alexander</a><br /><strong>Subject:</strong> 3272<br /><strong>Posted:</strong> 20-Feb-2012 at 10:38pm<br /><br />I think you misunderstood my problem. This is not taking place in IIS, this is taking place in Cassini, during Visual Studio development. In any case, the problem is not an IIS problem, but a DevForce problem. "<span style="color: red;">allowAnonymousLogin<font color="#000000">" is a DevForce setting in web.config.<div>&nbsp;</div>Also, I'm not sure how <em>RequiresAuthorization or RequiresRoles </em>will help. This problems happens DURING authentication, so how would requiring a user to be authorized or in a role help when the user isn't even logged in yet?<div>&nbsp;</div>Query interception? Just to implement a MembershipProvider? That seems just a bit excessive to me...</font></span>]]>
   </description>
   <pubDate>Mon, 20 Feb 2012 22:38:24 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3272&amp;PID=12703#12703</guid>
  </item> 
  <item>
   <title>How to use DevForce entities in authentication :   Hi Alexander,You need to have...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3272&amp;PID=12702#12702</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 3272<br /><strong>Posted:</strong> 20-Feb-2012 at 1:57pm<br /><br />Hi Alexander,<div>&nbsp;</div><div>You need to have anonymous access enabled in IIS otherwise, you will not be able to access public resources (ie.&nbsp;login and/or registration).</div><div>&nbsp;</div><div>What you could do is to decorate your entities with <em>&#091;RequiresAuthorization&#093;</em>&nbsp;and/or <em>&#091;RequiresRoles&#093;</em> (more on that in the <a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/query-security-attribute" target="_blank">DevForce Resource Center</a>).</div><div>As an alternative, you could also intercept the query and validate the access to data based on user there.</div><div>&nbsp;</div><div>Regards,</div><div>&nbsp;&nbsp; Silvio.</div>]]>
   </description>
   <pubDate>Mon, 20 Feb 2012 13:57:46 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3272&amp;PID=12702#12702</guid>
  </item> 
  <item>
   <title>How to use DevForce entities in authentication : I&amp;#039;m attempting to implement...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3272&amp;PID=12701#12701</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1394" rel="nofollow">alexander</a><br /><strong>Subject:</strong> 3272<br /><strong>Posted:</strong> 20-Feb-2012 at 6:16am<br /><br />I'm attempting to implement my own ASP.NET providers (such as the MembershipProvider) using DevForce entities, but I'm encountering nothing but issues.<br><br>If I set "<span style="color: red;">allowAnonymousLogin<font color="#000000">" to "<font color="#0033FF">false</font>" then any attempt to access entities causes an exception, like in this code:<br></font></span><pre style="font-family:C&#111;nsolas;font-size:13;color:black;:white;"><span style="color:#2b91af;">User</span>&nbsp;user&nbsp;= entities.Users.AddIncludePaths(&nbsp;<span style="color:#a31515;">"ParentUser"</span>,&nbsp;<span style="color:#a31515;">"UserSetting"</span>&nbsp;).SingleOrDefault( u&nbsp;=&gt;&nbsp;u.Username&nbsp;==&nbsp;username&nbsp;&amp;&amp;&nbsp;u.ParentUser&nbsp;!=&nbsp;<span style="color:blue;">null</span>&nbsp;);</pre>It throws a LoginException with the following message: "The current user is not authorized, and guest access is not allowed."<br><br>Help would be appreciated.<br>]]>
   </description>
   <pubDate>Mon, 20 Feb 2012 06:16:27 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3272&amp;PID=12701#12701</guid>
  </item> 
 </channel>
</rss>