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  |  

DotNetNuke Marketplace
  Ads  
Biz Modules provides professional business modules and solutions for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
OnyakTech
The best choice for your web site host, email hosting, and domain registration.
CrystalTech Web Hosting™
 


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.

 


TronixSoft
Hosting for local businesses that want more from their websites.
www.TronixSoft.com
The Forerunner Network
The Forerunner Network consists of a group of Dynamic Website & Interactive Membership Portal hosting services that are managed by Forerunner Communications. Our services span a wide range of markets and enable individuals, organizations and businesses to build and manage dynamic, interactive portals and websites.
The Forerunner Network
ZLDNN.COM
We provide commercial DotNetNuke modules.
www.zldnn.com

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