enclosed community - sign in required

rated by 0 users
This post has 29 Replies | 10 Followers

Not Ranked
Posts 2
Points 55
John.Doe Posted: Fri, Dec 8 2006 9:18 PM

Hi,

 I installed the Community Server yesterday on my local machine and was wondering if it is possible to make the whole thing private. So that if you want to access any part of the CS you will be redirected to the login page if you are not logged in yet. Is that just a setup issue or is that something where I would need the single-sign-on addon for?

  • | Post Points: 50
Top 200 Contributor
Posts 105
Points 6,690

You could do this:

Modify this section of SiteUrls.config as follows:

 <link name="home" resourceUrl="home" resourceName="home" roles="Registered Users" />
 <link name="blog" resourceUrl="webloghome" resourceName="weblogs" roles="Registered Users" applicationType = "Weblog" />
 <link name="forums" resourceUrl="forumshome" resourceName="forums" roles="Registered Users" applicationType = "Forum" />
 <link name="gallery" resourceUrl="galleryhome" resourceName="photos" roles="Registered Users" applicationType = "Gallery" />
 <link name="files" resourceUrl="fileshome" resourceName="files" roles="Registered Users" applicationType = "FileGallery" />

Then add the following to Web.config in the sites root where you see the other location tags:

 <location path="">
  <system.web>
   <authorization>
    <allow roles="Registered Users" />
    <deny users="?" />
   </authorization>
  </system.web>
 </location>
Ryan Olshan Microsoft MVP, ASP.NET Blog | Group | Website | Strong Coders Community
  • | Post Points: 35
Top 500 Contributor
Posts 56
Points 895

If you'd like to see an example, we are working with a group to customize CS as an inter-organizational extranet. Initially, it will be members-only. After official members become comfortable with working online, they will consider opening it up to anonymous, public users and to other member groups. See www.mchic.ca 

Jul 16/8 Note: Project ended; site no longer available.

A. Simon Mielniczuk ITScooperative Toronto
Not Ranked
Posts 10
Points 125
Smosmosmo replied on Tue, Dec 11 2007 8:54 AM

Ryan Olshan:

You could do this:

Modify this section of SiteUrls.config as follows:

 <link name="home" resourceUrl="home" resourceName="home" roles="Registered Users" />
 <link name="blog" resourceUrl="webloghome" resourceName="weblogs" roles="Registered Users" applicationType = "Weblog" />
 <link name="forums" resourceUrl="forumshome" resourceName="forums" roles="Registered Users" applicationType = "Forum" />
 <link name="gallery" resourceUrl="galleryhome" resourceName="photos" roles="Registered Users" applicationType = "Gallery" />
 <link name="files" resourceUrl="fileshome" resourceName="files" roles="Registered Users" applicationType = "FileGallery" />

Then add the following to Web.config in the sites root where you see the other location tags:

 <location path="">
  <system.web>
   <authorization>
    <allow roles="Registered Users" />
    <deny users="?" />
   </authorization>
  </system.web>
 </location>

 When I try this, it works, but some pages give an error. For ex. when i click on the link, I forgot my password i get the following error:

Server Error


HTTP Error 500.19 - Internal Server Error

Description: The requested page cannot be accessed because the related configuration data for the page is invalid.

Error Code: 0x800700b7

Notification: BeginRequest

Module: IIS Web Core

Requested URL: http://cs2007:80/user/EmailForgottenPassword.aspx

Physical Path: D:\Visual Studio 2005\Projects\Insites Community Server\Web\user\EmailForgottenPassword.aspx

Logon User: Not yet determined

Logon Method: Not yet determined

Handler: Not yet determined

Config Error: Config section 'system.web/authorization' already defined. Sections must only appear once per config file. See the help topic <location> for exceptions

Config File: \\?\D:\Visual Studio 2005\Projects\Insites Community Server\Web\user\web.config

Config Source:
   84:     <system.web>
   85:       <authorization>
   86:         <allow roles="Registered Users" />

More Information... This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error.


Server Version Information: Internet Information Services 7.0.

I have this for other pages aswell (ex. Memberlist page)

 Also, when I am not logged in, and on the homepage. When I change the url by adding /blogs or /forums. I can read the content although I am not logged in!

Is there a way around this?

 Kind Regards,

Sven Moreels

Not Ranked
Posts 6
Points 90

Put this in your site master file:

<CSControl:ConditionalAction runat="server">
         <Conditions Operator="And" runat="server">
             <CSControl:Conditions Operator="Not" runat="server">
                 <CSControl:UserInRoleCondition UseAccessingUser="true" Role="Registered Users" runat="server" />
             </CSControl:Conditions>
             <CSControl:Conditions Operator="Not" runat="server">
                 <CSControl:CurrentSiteUrlCondition SiteUrlName="common.login" runat="server" /> 
             </CSControl:Conditions>
         </Conditions>
         <Actions>
             <CSControl:GoToSiteUrlAction ID="GoToSiteUrlAction1" UrlName="login" runat="server" />
         </Actions>
     </CSControl:ConditionalAction> 

  • | Post Points: 35
Not Ranked
Posts 13
Points 200
cillroy replied on Sat, Aug 9 2008 2:41 AM

the only issue with this is that the password reset page and the join page will not come up now...  i put this is my master.master under the theme i am using == was this the wrong file?

  • | Post Points: 5
Top 10 Contributor
Posts 4,039
Points 61,285
TelligentSupportTeam

I'll suggest the folowing modifications

     <CSControl:ConditionalAction runat="server">
         <Conditions Operator="And" runat="server">
             <CSControl:Conditions Operator="Not" runat="server">
                 <CSControl:UserPropertyValueComparison runat="server" ComparisonProperty="IsAnonymous" Operator="IsSetOrTrue" UseAccessingUser="true" />
             </CSControl:Conditions>
             <CSControl:Conditions Operator="Or" runat="server">
                 <CSControl:CurrentSiteUrlCondition SiteUrlName="common.login" runat="server" />
                 <CSControl:CurrentSiteUrlCondition SiteUrlName="user.user_Register" runat="server" />  
                 <CSControl:CurrentSiteUrlCondition SiteUrlName="user_ForgotPassword" runat="server" />  
                  <CSControl:CurrentSiteUrlCondition SiteUrlName="user_AcceptInvitation" runat="server" />  
             </CSControl:Conditions>
         </Conditions>
         <Actions>
             <CSControl:GoToSiteUrlAction  UrlName="login" runat="server" />
         </Actions>
     </CSControl:ConditionalAction>

  • | Post Points: 35
Not Ranked
Posts 13
Points 200
cillroy replied on Sat, Aug 9 2008 9:49 AM

almost perfect!  can I also block the homepage for anonymous?

  • | Post Points: 20
Top 10 Contributor
Posts 4,039
Points 61,285
TelligentSupportTeam

The above code will block every page appart from: Login, Join, Accept Invitation and Forgot Password pages.  And should block the homepage as well.

  • | Post Points: 20
Not Ranked
Posts 13
Points 200
cillroy replied on Sun, Aug 10 2008 4:05 PM

homepage is still being shown to non registered (i.e. everyone) users -- any other suggestions

 

I am extrememly grateful also for the help provided thus far.

 

to see you can go to http://www.cullens.com

 

  • | Post Points: 20
Top 75 Contributor
Posts 319
Points 4,880
shakes replied on Sun, Aug 10 2008 7:33 PM

Try this....Leave the location part out

 

<system.web>
    <authorization>
      <deny users="?" />
    </authorization>
  </system.web>

peace shakes

Carolina Pulse

  • | Post Points: 20
Not Ranked
Posts 13
Points 200
cillroy replied on Sun, Aug 10 2008 9:15 PM

like all mistakes -- it was my fault!!!

I had the following:

    <location path="user/EditProfile.aspx">

      <system.web>

        <authorization>

        <allow roles="Registered Users" />

          <deny users="?" />

        </authorization>

      </system.web>

    </location>

 I changed to :

    <location path="">

      <system.web>

        <authorization>

          <allow roles="Registered Users" />

          <deny users="?" />

        </authorization>

      </system.web>

    </location>

and now it is working as expected!  thanks for the help!

  • | Post Points: 20
Top 10 Contributor
Posts 4,039
Points 61,285
TelligentSupportTeam

Note, this will block anonymous users from using the acceptinvitation, join, and forgot password pages.  You'll want to add exceptions for those pages into your web.config

  • | Post Points: 20
Not Ranked
Posts 13
Points 200
cillroy replied on Mon, Aug 11 2008 9:45 AM

 

  <location path="user/EditProfile.aspx">
    <system.web>
      <authorization>
        <deny users="?" />
      </authorization>
    </system.web>
  </location>

  <location path="">
    <system.web>
      <authorization>
        <allow roles="Registered Users" />
        <deny users="?" />
      </authorization>
    </system.web>
  </location>

  <location path="user/EmailForgottenPassword.aspx">
    <system.web>
      <authorization>
        <allow users="?" />
      </authorization>
    </system.web>
  </location>

  <location path="user/CreateUser.aspx">
    <system.web>
      <authorization>
        <allow users="?" />
      </authorization>
    </system.web>
  </location>

solves the problem -- thanks again all!!!

  • | Post Points: 20
Not Ranked
Posts 5
Points 70

When I do this I get the right functionality as in it defaults to login.aspx and now the links on the login forum work but for some reason it wont render the theme styles, it is all in completely plain html. If I comment out

  <location path="">
    <system.web>
      <authorization>
        <allow roles="Registered Users" />
        <deny users="?" />
      </authorization>
    </system.web>
  </location>

Then everything looks fine and it renders the theme style but it defaults to home.aspx with the user dashboard instead of login.aspx. Does anyone know why this could be happening? And of course, I have the code in the master.master...does it have to be in a specific spot? Thanks for the help!!

Page 1 of 2 (30 items) 1 2 Next > | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com