<?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 : Custom Authentication</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Custom Authentication</description>
  <pubDate>Wed, 29 Apr 2026 08:06:59 -700</pubDate>
  <lastBuildDate>Mon, 21 Mar 2011 10:49:52 -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=2567</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>Custom Authentication : The UserIdentity constructor you&amp;#039;re...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2567&amp;PID=10232#10232</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> 2567<br /><strong>Posted:</strong> 21-Mar-2011 at 10:49am<br /><br />The UserIdentity constructor you're using defaults IsAuthenticated to false.&nbsp;&nbsp; Use:<DIV>&nbsp;</DIV><DIV>&nbsp; new UserIdentity(name, type, isAuthentication)</DIV><DIV>&nbsp;</DIV><DIV>to create an authenticated user.</DIV>]]>
   </description>
   <pubDate>Mon, 21 Mar 2011 10:49:52 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2567&amp;PID=10232#10232</guid>
  </item> 
  <item>
   <title>Custom Authentication : Ok, I will try that,One more thing,...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2567&amp;PID=10226#10226</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1100" rel="nofollow">xer0ne</a><br /><strong>Subject:</strong> 2567<br /><strong>Posted:</strong> 21-Mar-2011 at 3:21am<br /><br />Ok, I will try that,<div><br></div><div>One more thing, why does IsAuthenticated always false, I tried using formsauthentication and still not authenticated.</div>]]>
   </description>
   <pubDate>Mon, 21 Mar 2011 03:21:04 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2567&amp;PID=10226#10226</guid>
  </item> 
  <item>
   <title>Custom Authentication : Creating a new MainRoot EntityManager...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2567&amp;PID=10209#10209</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> 2567<br /><strong>Posted:</strong> 18-Mar-2011 at 6:06pm<br /><br />Creating a new MainRoot EntityManager is causing the bad behavior.&nbsp; Every EntityManager will actually try to login, whether it's being used on the client or not.&nbsp; That's why the Login method is passed an EntityManager - this is a "logged in", connected EntityManager which you can use to run queries.&nbsp; So in this case, if you instead do: <DIV>&nbsp;</DIV><DIV>&nbsp; MainRoot&nbsp;svcRoot&nbsp;=&nbsp;<SPAN style="COLOR: blue">new</SPAN>&nbsp;MainRoot(entityManager)</DIV><DIV>&nbsp;</DIV><DIV>... you can construct your domain-specific EM from the logged in EM, and then run your InfoUsers query.</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 18 Mar 2011 18:06:36 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2567&amp;PID=10209#10209</guid>
  </item> 
  <item>
   <title>Custom Authentication : Hi,	I having problems with customizing...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2567&amp;PID=10191#10191</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1100" rel="nofollow">xer0ne</a><br /><strong>Subject:</strong> 2567<br /><strong>Posted:</strong> 16-Mar-2011 at 9:12pm<br /><br />Hi,<div><br></div><div><span ="Apple-tab-span" style="white-space:pre">	</span>I having problems with customizing the login process, here is what i've done so far</div><div><br></div><div>&nbsp;I'm &nbsp;using these settings in the web.config</div><div><br></div><div><pre style="font-family:C&#111;nsolas;font-size:13;color:black;:white;"><span style="color:blue;">&lt;</span><span style="color:#a31515;">objectServer</span><span style="color:blue;">&nbsp;</span><span style="color:red;">remoteBaseURL</span><span style="color:blue;">=</span>"<span style="color:blue;">http://localhost</span>"<span style="color:blue;">&gt;</span><span style="color:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color:#a31515;">clientSettings</span><span style="color:blue;">&nbsp;</span><span style="color:red;">isDistributed</span><span style="color:blue;">=</span>"<span style="color:blue;">false</span>"<span style="color:blue;">/&gt;</span><span style="color:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color:#a31515;">serverSettings</span><span style="color:blue;">&nbsp;</span><span style="color:red;">useAspNetSecurityServices</span><span style="color:blue;">=</span>"<span style="color:blue;">true</span>"<span style="color:blue;">&nbsp;</span><span style="color:red;">loginManagerRequired</span><span style="color:blue;">=</span>"<span style="color:blue;">true</span>"<span style="color:blue;">&nbsp;</span><span style="color:red;">allowAnonymousLogin</span><span style="color:blue;">=</span>"<span style="color:blue;">true</span>"<span style="color:blue;">&nbsp;/&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:blue;">&nbsp;&lt;/</span><span style="color:#a31515;">objectServer</span><span style="color:blue;">&gt;</span></pre><pre style="font-family:C&#111;nsolas;font-size:13;color:black;:white;"><span style="color:blue;"><br></span></pre><pre style="font-family: C&#111;nsolas; font-size: 13px; -: initial; -attachment: initial; -origin: initial; -clip: initial; : white; -: initial initial; -repeat: initial initial; "><font ="Apple-style-span" color="#0000FF">*I used the devforce Business application template jetpack theme for silverlight.&nbsp;</font></pre><pre style="font-family: C&#111;nsolas; font-size: 13px; -: initial; -attachment: initial; -origin: initial; -clip: initial; : white; -: initial initial; -repeat: initial initial; "><font ="Apple-style-span" color="#0000FF"></font><span ="Apple-style-span" style="color: rgb0, 0, 255; ">* move around the some of the template files to a wcf ria class library. build ok</span></pre><pre style="font-family: C&#111;nsolas; font-size: 13px; -: initial; -attachment: initial; -origin: initial; -clip: initial; : white; -: initial initial; -repeat: initial initial; "><span ="Apple-style-span" style="color: rgb0, 0, 255; ">* created a class to Implement IEntityLoginManager, put it on my wcf .net class project</span></pre><pre style="font-family: C&#111;nsolas; font-size: 13px; -: initial; -attachment: initial; -origin: initial; -clip: initial; : white; -: initial initial; -repeat: initial initial; "><pre style="font-family: C&#111;nsolas; font-size: 13px; -: initial; -attachment: initial; -origin: initial; -clip: initial; : white; ">&nbsp;<span style="color: blue; ">public</span>&nbsp;<span style="color: blue; ">partial</span>&nbsp;<span style="color: blue; ">class</span>&nbsp;<span style="color: rgb43, 145, 175; ">LoginManager</span>&nbsp;:&nbsp;<span style="color: rgb43, 145, 175; ">IEntityLoginManager</span>&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue; ">public</span>&nbsp;<span style="color: rgb43, 145, 175; ">IPrincipal</span>&nbsp;Login(<span style="color: rgb43, 145, 175; ">ILoginCredential</span>&nbsp;credential,&nbsp;<span style="color: rgb43, 145, 175; ">EntityManager</span>&nbsp;entityManager)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: rgb43, 145, 175; ">LoginCredential</span>&nbsp;guestCredential&nbsp;=&nbsp;&nbsp;<span style="color: blue; ">new</span>&nbsp;<span style="color: rgb43, 145, 175; ">LoginCredential</span>(<span style="color: rgb163, 21, 21; ">"Guest"</span>,&nbsp;<span style="color: blue; ">string</span>.Empty,&nbsp;<span style="color: blue; ">string</span>.Empty); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue; ">if</span>&nbsp;(credential&nbsp;==&nbsp;<span style="color: blue; ">null</span>)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;credential&nbsp;=&nbsp;guestCredential;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue; ">else</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MainRoot&nbsp;svcRoot&nbsp;=&nbsp;<span style="color: blue; ">new</span>&nbsp;MainRoot();&nbsp;//EF created from devforce that contains the usernames and password&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>&nbsp;<font ="Apple-style-span" color="#FF6600">&nbsp;&nbsp;InfoUser&nbsp;entUser&nbsp;=&nbsp;svcRoot.InfoUsers.Where(p&nbsp;=&gt;&nbsp;p.UserName&nbsp;==&nbsp;credential.UserName&nbsp;&amp;&amp;&nbsp;p.Password&nbsp;==&nbsp;credential.Password)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.SingleOrDefault();</font></b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue; ">if</span>&nbsp;(entUser&nbsp;!=&nbsp;<span style="color: blue; ">null</span>)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue; ">return</span>&nbsp;CreatePrincipalUser(credential);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue; ">public</span>&nbsp;<span style="color: blue; ">void</span>&nbsp;Logout(<span style="color: rgb43, 145, 175; ">IPrincipal</span>&nbsp;principal,&nbsp;<span style="color: rgb43, 145, 175; ">EntityManager</span>&nbsp;entityManager)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: green; ">//no&nbsp;special&nbsp;processing&nbsp;needed</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue; ">private</span>&nbsp;<span style="color: rgb43, 145, 175; ">IPrincipal</span>&nbsp;CreatePrincipalUser(<span style="color: rgb43, 145, 175; ">ILoginCredential</span>&nbsp;credential)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue; ">var</span>&nbsp;identity&nbsp;=&nbsp;<span style="color: blue; ">new</span>&nbsp;<span style="color: rgb43, 145, 175; ">UserIdentity</span>(credential.UserName);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue; ">var</span>&nbsp;principal&nbsp;=&nbsp;<span style="color: blue; ">new</span>&nbsp;<span style="color: rgb43, 145, 175; ">UserProfile</span>(identity,&nbsp;<span style="color: blue; ">new</span>&nbsp;<span style="color: blue; ">string</span>&#091;&#093;&nbsp;{&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue; ">return</span>&nbsp;principal;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</pre></pre></div><div>}</div><div><br></div><div>* made a query Interceptor</div><div><pre style="font-family:C&#111;nsolas;font-size:13;color:black;:white;">&nbsp;<span style="color:blue;">public</span>&nbsp;<span style="color:blue;">class</span>&nbsp;<span style="color:#2b91af;">QueryInterceptor</span>&nbsp;:&nbsp;<span style="color:#2b91af;">EntityServerQueryInterceptor</span>&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">protected</span>&nbsp;<span style="color:blue;">override</span>&nbsp;<span style="color:blue;">bool</span>&nbsp;AuthorizeQuery()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:green;">//return&nbsp;base.AuthorizeQuery();</span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">bool</span>&nbsp;blnAllowed&nbsp;=&nbsp;<span style="color:blue;">false</span>; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">if</span>&nbsp;(<span style="color:blue;">this</span>.Principal.Identity.IsAuthenticated)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;blnAllowed&nbsp;=&nbsp;<span style="color:blue;">true</span>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">else</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">if</span>&nbsp;(<span style="color:blue;">this</span>.Query.ElementType&nbsp;==&nbsp;<span style="color:blue;">typeof</span>(<span style="color:#2b91af;">InfoUser</span>))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;blnAllowed&nbsp;=&nbsp;<span style="color:blue;">true</span>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">return</span>&nbsp;blnAllowed;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;}</pre><pre style="font-family:C&#111;nsolas;font-size:13;color:black;:white;">* I did not touch the authenticationManager leave it as is. well change the user property to my user type.</pre><pre style="font-family:C&#111;nsolas;font-size:13;color:black;:white;">now the problem is the one highlighted in orange, it saying inner exception, something to do with defaultmanager,</pre><pre style="font-family:C&#111;nsolas;font-size:13;color:black;:white;"> basically what im trying to do is login the user, lookup the credential on that table and authenticate but the problem is the </pre><pre style="font-family:C&#111;nsolas;font-size:13;color:black;:white;">EntityManager need to be login first, so i made a guest credentials, but it get logout by the authenticationmanager every time </pre><pre style="font-family:C&#111;nsolas;font-size:13;color:black;:white;">a user would login, so i get a entityManager.Principal = null, if i don't logout the guest user,</pre><pre style="font-family:C&#111;nsolas;font-size:13;color:black;:white;"> it will not carry on the login process and my custom login is not called.</pre><pre style="font-family:C&#111;nsolas;font-size:13;color:black;:white;">I need this working so continue a prototype using your product. the documentation is not helping much on what i'm trying to accomplished.</pre></div><div><br></div>]]>
   </description>
   <pubDate>Wed, 16 Mar 2011 21:12:04 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2567&amp;PID=10191#10191</guid>
  </item> 
 </channel>
</rss>