Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

$4.95 Windows Hosting at Webhost4life.com
  Ads  
 


  Sponsors  

Meet Our Sponsors

The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Authenticate through DNN to custom app
Previous Previous
 
Next Next
New Post 8/17/2006 8:33 AM
User is offline Tony Stoker
6 posts
10th Ranked


Authenticate through DNN to custom app 

I have created a custom db application and created an application on my webserver.  I have placed the directory on the root which right now our DNN is installed.  I setup the membership to point to the DNN membership database and also copied the machine key from the DNN web.config to my custom app web.config.  But it still doesn't authenticate....

Is this possible to do?

my main site is www.domain.com and then I have the custom app as www.customapp.domain.com.  Through my readings I thought I understood as long as I use the same machine key it should work.

What am I missing?

 
New Post 8/17/2006 11:18 PM
User is offline Nigel Liefrink
20 posts
10th Ranked


Re: Authenticate through DNN to custom app 

The actual signing in in DNN Uses this method to authenticate (in VB for DNN)

System.Web.Security.formsAuthentication.SetAuthCookie(m.LoginName, false);

In order for the sub domain to read the same cookie as the top domain you have to se the cookie.Domain property to ".domain.com" this will tell all the sub domains to use the same cookie information ( I think the cookies called ASPNETSESSION or something.) The dot tells all sub domains to use this cookie.

Adding some code to the /admin/security/signin.ascx control at the end of the         
      Private Sub cmdLogin_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdLogin.Click
method

like

//set the cookie to be used across domains..
HttpContext ctx = HttpContext.Current;
if (ctx != null)
{
   //set cookies to the top domain configured in the web config.
   foreach (string ck in ctx.Response.Cookies.Keys)
   {
      
((HttpCookie)ctx.Response.Cookies[ck]).Domain = ".domain.com"   //Config.GetSetting("Domain");
   }
}

 

Also your custom App will have to use the same authentication methods.. I think the cookie just stores the username.

You may be able to read the username from the cookie and log them in that way, or just use the same cookie to authenticate, it is just the standard windows authentication (I think), so using the windows methods may be the way to go.

 

 

 


 

 
New Post 8/23/2006 11:18 AM
User is offline Tony Stoker
6 posts
10th Ranked


Re: Authenticate through DNN to custom app 
Thank you for responding and I hope I can implement this....do you know how the code would be written in VB.NET
 
New Post 8/23/2006 7:10 PM
User is offline Nigel Liefrink
20 posts
10th Ranked


Re: Authenticate through DNN to custom app 

courtesy of http://www.carlosag.net/Tools/CodeTranslator/Default.aspx

Dim ctx As HttpContext HttpContext.Current
If (Not (ctx) Is Nothing) Then
    
'set cookies to the top domain configured in the web config.
    
For Each ck As String In ctx.Response.Cookies.Keys
        
CType(ctx.Response.Cookies(ck),HttpCookie).Domain ".domain.com"
        
'Config.GetSetting("Domain");
    
Next
End If

If you can't translate that, you may have some trouble implementing it, but good luck.


 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Authenticate through DNN to custom app
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Cygnusoft Custom Software
Cygnusoft has been providing cutting-edge custom software solutions for 20 years. Cygnusoft is also a leading start-up incubator, helping our partners build successful new businesses.
www.cygnusoft.com
Digicon: DotNetNuke design and development
Digicon is based in Brisbane, Queensland, Australia
digicon.com.au
Live Visitor Tracking & Live Chat For DotNetNuke
Track your visitors in real time and add live chat for sales & support. Free Trial.
www.whoson.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP