Showing posts with label Anonymous. Show all posts
Showing posts with label Anonymous. Show all posts

Tuesday, November 30, 2010

Google Chrome uses IE login information

Does Google chrome uses IE login settings and information?

No… that would be crazy, right?

But – how else would explain this strange behaviour:

I have a SharePoint site that supports anonymous login. I have IE open and logged in to the site as user A, and in the site the is a tasks list that does not allow anonymous users to view items.

When I opened chrome and browsed to the site home page – as expected, I was still anonymous to the site. But as soon as I hit the link to the tasks list – it logged me in as user A, without even asking for my credentials!

So, Google chrome does not ask for login information? Does it share the login information with IE? This is kind of troubling if true, as so far I used several browsers to make sure I get isolated sessions and logins.

So, I opened IE internet options –> security settings and forced IE to work in anonymous mode only:
image

Now, when I open Chrome and try to access that list it prompts me for user name and password before it logs in.

Am I the only one surprised?

Sunday, January 20, 2008

Cache profile for WCM internet site

Hmmm… this took me a while to understand… but the solution is rather simple.

I wanted to activate cache profile for my customer WCM site, so that only anonymous users will see a shared cached version of the page.

Naturally – all anonymous users see the same version of the page and do not have editing rights nor can they see draft versions – so typically all you need to do is:
1: Go to site actions à site settings àsite collection administration à site collection output cache
2: Set the anonymous cache profile to “public internet (purely anonymous)
3: Click OK

And you are done.

But – I noticed there were no improvement in system-load (FE and DB servers) per requests and overall performance did not improve.

I went back to site collection output cache settings page and selected the “Enable debug cache information on pages” checkbox. Enabling this will append to the HTML a debug message stating when the current page was rendered and if cache was in use.

To my surprise (or not) I found this message:
"8 Output cache not used. Reason: User can view an unpublished version of the current page."

This meant that caching was not activated for anonymous users because they had access for unpublished version of current page? Not!

After contacting the WCM team, I got an interesting reply from Kai Lee (Thanks!) saying that this message will come up if the current user (anonymous in my case) have editing access or can view draft versions ANYWHERE IN THE SITE COLLECTION!

Well, I still have to check where anonymous users have this access in my site collection (worrying…) but there is (thank god!) a nice workaround.

Going into the “public internet” cache profile allows you to set "Allow Writers to view cached content" to “true”.

This is important to understand: for authenticated users, who can edit pages and suppose to view draft versions – this is BAD. But for my scenario – where I have no interest of allowing anonymous users to view these contents anyhow – it is a good workaround and what do you know?
It solved the problem!!!

So thanks Kai Lee again,

Hope this will save some time to the rest of you…

Thanks, Shai Petel.

Tuesday, December 11, 2007

Using InfoPath Forms Server with anonymous users

For so long I have been trying to convince my customers that the right combination of InfoPath, MOSS and workflow can solve 70% of their day to day business needs.

Well, guess what – I finally succeeded.

Only to learn that by default – forms server does not allow anonymous users to create new forms.

Well, my customer wanted to implement a “contact us” and “register to…” forms on his WCM MOSS internet site that will (of course) be published on the internet and allow any potential customer to fill in these forms with no need for logging in or registering for their site.

So, the solution for this consisted of 2 major steps.

Step 1 – defining out SharePoint site to use forms authentication provider.



I extended my AD web application (i.e. http://moss.kwizcom.com ) to a new web application (i.e. http://forms.kwizcom.com ) that uses forms authentication – this way I could create a simple user that has no privileges at all except to create items in the forms library (no edit / delete as well).

Step 2 – setting up a default logon user for anonymous users.



After step 1, all I had to do is to create a forms authentication user named: Internet User and give him write access to the forms library. Now, I added some code to auto login with that user when anyone browses to this web application http://forms.kwizcom.com.

For more information about completing step 1 you can see may blogs articles – simply google it.

I like Andrew connell’s one here: http://www.andrewconnell.com/blog/articles/HowToConfigPublishingSiteWithDualAuthProvidersAndAnonAccess.aspx

After you have forms authentication enabled on your second web application, the solution is rather easy.
  1. Create an InfoPath form, save it and publish it to a document library on your SharePoint server
  2. Create a new permission level on your site collection for “Add Only Read Only Permission”
    1. Go to Site Settings – top level site settings
    2. Click on advanced permissions
    3. On the “Settings” menu click on “Permission Levels”
    4. Add a new permission level named “Add Only Read Only Permission”
    5. Select only the “Add Items” check box (others will be auto selected – leave them)
    6. Click “Create”
  3. Create a new forms user named: Internet User
    1. Use the ASP.Net application to create a new user as explained in the Andrew Connell blog post above
  4. Give Internet User “Add Only Read Only” permission on the published form library
    1. Browse to the document library
    2. On the “Settings“ menu click “X Library Settings”
    3. Click on “permissions for this document library”
    4. If you don’t see the “new” menu item – you will have to break permissions for this library by clicking “Actions” and then “Edit Permissions”
    5. Click “New”, select Internet User give user permission directly to “Add Only Read Only Permission” permission level.
  5. Set up auto login for Internet User
    1. Go to the http://forms.kwizcom.com web root folder (by default: under c:\inetpub\wwwroot\wss\virtualdirectories\*
    2. Locate the global.asax file, back it up and open it in notepad
    3. Add this lines to the file to enable auto login as Internet User,
      replace [password] with the password you given the user.
      <script runat="server">
      public void FormsAuthentication_OnAuthenticate(object sender, FormsAuthenticationEventArgs args)
      {
      if (Membership.ValidateUser("Inernet User", "[password]"))
      {
      FormsAuthentication.SetAuthCookie("Inernet User", true);
      }
      }
      </script><.div>
    4. Save the file and close it.
Now we have to prepare the link for filling out this form using the browser.
To do so you will need a client PC that does not have InfoPath installed, browse to http://moss.kwizcom.com to the forms library, and click “New” on the forms library.
The forms server will open a browser based form for you to fill in.
Copy the URL of the create form page and replace http://moss.kwizcom.com with http://forms.kwizcom.com , replace moss with forms anywhere you see it in the query string as well, except for the “Source=” query string parameter.

That’s it! Simply put that URL at your site where you want users to create forms from and you are done!

Note: you might want to prevent user from browsing to http://forms.kwizcom.com and redirect them to the http://moss.kwizcom.com. This can be done in several ways. For demo purposes you could add this javascript to your master pages to make them do the redirect for you:

<script>
if(window.location.href.toLowerCase().slice(0,12) == “http://forms”)
window.location.href = window.location.href.toLowerCase().replace(“http://forms”, “http://moss”)
</script>

Friday, June 15, 2007

Anonymous Users cannot access list views in MOSS Publishing sites

Hi All,

Again, I am posing you something I came across during a visit at one of my customers.

We are creating an internet portal based on MOSS Publishing WCM template. This portal is ment to be public and to allow anonymous users from the internet to view most of its contents.

But - as you may or may not know, anonymous users on WCM sites cannot view a list or library view pages, although they can browse directly to the document or list item when given the correct url. When trying to do so - they are prompted for user name and password... Also - and this is the main reason I had to look for a solution - when I added links to the documents into the current navigation of the site they did not appear for anonymous users.

After doing some investigation on the net I came across this KB #927082 on microsoft support site that explains this.

Apperantly all WCM sites are initialized with a special hidden feature that denies anonymous users from accessing dall and un-attactive SharePoint-like pages that does not fit a sexy-designed internet site.

This feature is called: "ViewFormPagesLockDown" and disabling it allows anonymous users to go around the site as I expected.

To disable this feature you must log on to the server and follow these steps:
1. Click Start, click Run, type cmd in the Open box, and then click OK.
2. Type the following lines at the command prompt. Press ENTER after each line.
cd /d %commonprogramfiles%\Microsoft Shared\Web Server Extensions\12\Bin
stsadm -o deactivatefeature -url http://ServerName -filename ViewFormPagesLockDown\feature.xml
3. Type exit to exit the command prompt.

After disabling this feature, you must turn anonymous access off and on again for changes to take effect.

Note: if you want it off only for one library or list like in my case, you can disable it, turn anonymous access on at that specific list and enable the feature again, leaving only that list opened for anonymous...