Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsAuthenticationAuthenticationUser Account & Authentication IssuesUser Account & Authentication Issues
Previous
 
Next
New Post
1/17/2008 7:23 PM
 

So far I have always been able to find answers to my DNN problems here by searching the forums but no such luck on this issue so I must post.  Please be gentle!

I'm having some strange problems with user accounts and authentication between multiple portals on an Intranet.  Currently on version 4.5.5

Portal 1:  Regular user accounts created - no problems

Portal 2: Using Windows Authentication - Users auto-login when they connect, user account created with domain name in front - no problems

New Portal 3: Trying to use Windows Authentication.  Setup just like Portal 2 but get error when activating from Admin>Authentication Menu "Windows Authentication is currently unavailable" but settings seem to stick when returning to the Auth. menu. 

Here's the main problem:  Portal 3: Users cannot login or create an account in portal 3 if that account name already exists on either portal 1 or 2.  However, a new user that has never setup an account on portal 1 or connected to portal 2 (auto-login) will be auto-login(ed) to portal 3 sometimes (always works for portal 2)(may have to force url to windowssign.aspx to login) so I know authentication is kind of working for portal 3.

I was expecting the user accounts to be independent between portals but there seems to be some kind of weird interaction between user accounts between the portals.  Am I doing something wrong or is this a bug and hence a reason why this functionality is going through a major makeover in the newer versions?  I've been holding off on the newer versions based upon a lot of discussion here about issues.  Is there a good stable version that Windows Authentication works in?

Any thoughts or advice is welcome.

Mark

 
New Post
1/17/2008 10:49 PM
 

Hi Mark

This is a known problem that I haven't found a work-around/code fix for yet. Generally you're correct in that user accounts are supposed to be independent between portals but if you look at the tables you'll see the Users table where all users are created. And then you'll also see a UserPortals table which contains two fields (other than the ID field) which just contains the UserID and the PortalID. The problem it seems, in my testing anyway, with autologin is that because of the way the DNN code loops through the authentication code it loses what the portalID should be so the additonal record isn't created in the UserPortals table.

Except for the issue that cropped up with DNN 4.8.0 and IIS7 integration any issues you're seeing for the newer versions of the provider are the same or have been around for as long in the version that you're using. The only difference between the AD provider that you're using in 4.5.5 and the provider that's package with 4.6.0 and newer is that the provider code has been separated into it's own project instead of being integral to the core.

 
New Post
1/18/2008 11:01 AM
 

Thank you Mike for the response and the explanation.  I think I understand what is happening.

I guess if there is no fix for the way I have these portals setup then my next question is how should I setup these portals so a user can connect and login or auto-login (preferred) to any of them?  Are "Child Portals" the answer?  I'm not even sure what the ramifications of that are.

What would be the best way to setup multiple portals all for a single companies Intranet such that users can move between them and not have to have different logins for each one?  Is the functionality I seek available in any 3rd party authentication modules?

Advise needed please!

Mark

 
New Post
1/18/2008 11:01 AM
 

We created a sp to sync users across all portals that runs every half hour. Now no matter what portal the user hits they get authenticated.

 

 USE [EFTPortal]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[SyncUserPortalsAndRoles]
AS
-- Variables for subqueries
DECLARE @PortalID int, @PortalName nvarchar(128), @NewUsers int, @PortalUsers int, @RegisteredUserRoleID int

-- Portal Cursor
DECLARE cur_portal CURSOR FOR
 SELECT p.PortalID, p.PortalName, r.RoleID
 FROM Portals p LEFT JOIN Roles r ON (r.PortalID = p.PortalID)
 WHERE r.RoleName = 'Registered Users'
 ORDER BY PortalID desc

-- Table Variable for Insert Records
DECLARE @tbl_UserID TABLE ( [UserID] int )

-- Open the Cursor
OPEN cur_portal

-- Retrieve the first record
FETCH NEXT FROM cur_portal
INTO @PortalID, @PortalName, @RegisteredUserRoleID

-- Loop while fetch retrieves records
WHILE @@FETCH_STATUS = 0
BEGIN
 -- Report Start Of Work
 PRINT N'Beginning work for Portal: ' + CAST(@PortalID AS nvarchar) + ' - ' + @PortalName
 PRINT N'Registered User Role: ' + CAST(@RegisteredUserRoleID AS nvarchar)

 -- Delete Users that have been removed from the main portal
 DELETE FROM UserPortals
 WHERE UserID in ( SELECT UserID
      FROM Users
      WHERE UserID NOT IN ( SELECT UserID
            FROM UserPortals
            WHERE PortalID = 0 )
      AND UserName NOT IN ('host','admin')
     )

 -- Retrieve the new users
 PRINT N'Retrieve New User Table'
 INSERT INTO @tbl_UserID ( [UserID] )
  SELECT DISTINCT [UserID]
  FROM UserPortals
  WHERE [UserID] NOT IN ( SELECT DISTINCT [UserID]
        FROM UserPortals
        WHERE [PortalID] = @PortalID )

 -- Retrieve the Insert User Count
 PRINT N'Retrieve New User Count'
 SELECT @NewUsers = COUNT(DISTINCT [UserID])
 FROM @tbl_UserID
 PRINT N'Count: ' + CAST(@NewUsers AS nvarchar)

 -- Retrieve the Current User Count
 PRINT N'Retrieve Current User Count'
 SELECT @PortalUsers = COUNT(DISTINCT [UserID])
 FROM UserPortals
 WHERE [PortalID] = @PortalID
 PRINT N'Count: ' + CAST(@PortalUsers AS nvarchar)

 -- Begin the Transaction
 BEGIN TRY
  BEGIN TRANSACTION;

  PRINT N'Insert New Users into UserRoles'
  -- Insert the missing records into User Roles
  INSERT INTO UserRoles ( [UserID], [RoleID] )
  SELECT DISTINCT [UserID], @RegisteredUserRoleID AS [RoleID]
  FROM @tbl_UserID
  WHERE [UserID] NOT IN ( SELECT [UserID]
        FROM UserRoles
        WHERE [RoleID] = @RegisteredUserRoleID )
        
  -- Insert the missing records into User Portals
  PRINT N'Insert New Users into UserPortals'
  INSERT INTO UserPortals ( [UserID], [PortalID], [CreatedDate], [Authorised] )
  SELECT DISTINCT [UserID], @PortalID AS [PortalID], GetDate() AS [CreatedDate], 1 AS [Authorised]
  FROM @tbl_UserID
 
  COMMIT TRANSACTION;
 END TRY
 BEGIN CATCH
  PRINT N'Rolling Back Transaction'
  ROLLBACK TRANSACTION;
 END CATCH

 -- Clear New Users
 PRINT N'Deleting UserID Records'
 DELETE FROM @tbl_UserID

 -- Fetch next record
 FETCH NEXT FROM cur_portal
 INTO @PortalID, @PortalName, @RegisteredUserRoleID
 
 -- Line Break
 PRINT N'----------------------------------------------'
END
-- Cleanup cursor
CLOSE cur_portal
DEALLOCATE cur_portal

 

 
New Post
1/18/2008 12:25 PM
 

This sounds like it would do what I need it to do.

Pardon my ignorance but what is a "sp"?  Scheduled Process???

Are there parts of this code that would have to be modified for my portals or is it usable as is?

Can you summarize how I would go about implementing this or point me to a reference that can explain it in more detail?

Thanks for your help!

Mark

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsAuthenticationAuthenticationUser Account & Authentication IssuesUser Account & Authentication Issues


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, 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 DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out