Jun
23

SharePoint 2010: transparent login with mixed authentication

Authentication in SharePoint 2007

In SharePoint 2007 it was possible to enable forms based authentication next to windows authentication only by extending a web application and basically running two separate applications on the same content database.

side from the problems with forms based authentication in SharePoint 2007, there were also some usability issues.

  • The two sites are accessed by a different url. For internal users the url could be https://intranet, for external users https://intranet.company.com.
    This is especially a problem when sending links to document or pages. The links point to a different site depending on if an internal or external user copied the link. This lead to a lot of confusion and unexpected errors
  • Email alerts sent by SharePoint itself can contain the wrong urls
  • Smartparts and some other customisations need to be deployed twice
  • Changes to the web.config need to be duplicated

Authentication in SharePoint 2010

SharePoint 2010 comes with a nice new feature that aims to solve this problem: Mixed Authentication. It allows for the configuration of multiple authentication providers (Windows authentication, forms authentication, trusted Identity providers) together using the same url, without having to extend the web application. Both external and internal users would access the web site on https://intranet.company.com for example.

By default the user has to choose the authentication method when upon logging in.

image

While this is very nice, and a great improvement over the previous version, the downside is that there is no more transparent authentication in an intranet environment.

With the correct browser settings is it possible to log on automatically when using windows authentication.

In Internet Explorer it can be configured in the security settings of the Local Intranet zone. These settings can also be pushed through group policies.

image

image

If the intranet is configured correctly, or “detected automatically”, all login attempts will transparently use the windows identity.

Each time a user tries to access the intranet, he is greeted by the “user friendly” choice above. Each time he tries to open a document stored on the intranet, he gets the same login popup.

In an intranet environment, this is simply unacceptable.

The solution for SharePoint 2010

Looking to improve on this situation we found a great blog post by Bryan Porter. By using a custom login page and custom PowerShell snap-in he was able to automatically choose the authentication provider based on the IP address of the user logging in.

The solution consists of two parts

  • A custom PowerShell snap-in that is used to manage the mappings between IP addresses and authentication providers. The mapping is stored in the Hierarchical Object Store, on the level of the Web Application.
  • A custom sign-in page. When the custom sign-in page is loaded it will first check the IP address of the user. Then it will check if the address is mapped to an authentication provider. If it is mapped, the user will be redirected to the sign-in page of that provider. In other words, if the mapping is found the “Select the credentials you want to use to logon to the SharePoint site” step of the sign in process is automated.

In order to use Bryan’s solution we added some features:

  • Wild card mapping. Authentication providers can now be mapped to wildcard IP range, for example 192.168.0.*
  • IPv6 support.
  • Fix the redirection to make “Sign in as a different user” work correctly

After installing the web application can be configured to automatically use Windows Authentication for a certain range of IP’s, and forms authentication for the others.

Update: The project is now available on codeplex: http://spautomaticsignin.codeplex.com/

We are currently using this solution for several customers.

 

Deployment

All commands are executed in the SharePoint 2010 Management Shell

The custom login page is deployed to the SharePoint Root: “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IDENTITYMODEL\LOGIN”

The assembly containing the code-behind of the login page and the powershell cmdlet code are deployed to the GAC

  1. Add the solution to the solution store

    stsadm -o addsolution -filename OrbitOne.SharePoint.Claims.SignIn.wsp

  2. Deploy the solution to all web applications

    stsadm -o deploysolution -name OrbitOne.SharePoint.Claims.SignIn.wsp -immediate -allowgacdeployment

    stsadm -o execadmsvcjobs

  3. Register the assembly

    C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\installutil /assemblyname "OrbitOne.SharePoint.Claims.SignIn, Culture=neutral, Version=1.0.0.0, PublicKeyToken=3c7a593397c60142"

Deployment of an updated version

  1. Retract and delete the existing solution

    stsadm -o retractsolution -name OrbitOne.SharePoint.Claims.SignIn.wsp -immediate

    stsadm -o execadmsvcjobs

    stsadm -o deletesolution -name OrbitOne.SharePoint.Claims.SignIn.wsp

  2. Deploy the new solution

    stsadm -o addsolution -filename OrbitOne.SharePoint.Claims.SignIn.wsp

    stsadm -o deploysolution -name OrbitOne.SharePoint.Claims.SignIn.wsp -immediate -allowgacdeployment

    stsadm -o execadmsvcjobs

  3.  

Configuration

In the SharePoint 2010 Management Console:

load the snap-in

Add-PSSnapin ClaimsSignInAdmin

Create a configuration object. Note: the url is the url of your web application

$config = Get-SPSignInConfiguration –webapplication “http://www.website.com”

Mappings can be managed with the following commands

  • View all configured mappings

    $config.ProviderMappings

  • Add a mapping

    $config.ProviderMappings.Add("192.168.20.*","Windows Authentication")

    $config.Update()

  • Remove a mapping

    $config.ProviderMappings.Remove("192.168.20.*")

    $config.Update()

  • Clear all mappings

    $config.ProviderMappings.Clear()

    $config.Update()

 

Configure the custom sign-in page

Configuration of a custom sign-in page is now a fully supported feature. In SharePoint 2007 it was possible to do this in the web.config, in Sharepoint 2010 it is a settings in the Central Administration.

Application Management -> Manage Web Applications

Select one - > Authentication providers –> select the Zone (usually Default)

image

Is there a way to do this from Powershell? It would make the deployment a lot faster.

Code

The IP address to Authentication provider mappings are stored in the Hierarchal Object Store associated with a web application. To create a custom Persisted Object for SharePoint all that is needed is to inherit from SPPersistedObject and mark the fields to persist with the “Persisted” attribute.

public class SignInConfiguration : SPPersistedObject
{
    [Persisted()]
    private Dictionary<string, string> m_providerMappings = new Dictionary<string, string>();
    
    public SignInConfiguration(): base()
    { }

    public SignInConfiguration(string name, SPPersistedObject parent): base(name, parent)
    { }

    public SignInConfiguration(string name, SPPersistedObject parent, Guid id): base(name, parent, id)
    { }
    
    public Dictionary<string, string> ProviderMappings
    {
        get { return m_providerMappings; }
    }
}

To add this object to a web application or to get an existing one from a web application a custom PowerShell cmdlet is used

[Cmdlet("Get", "SPSignInConfiguration", DefaultParameterSetName = "DefaultSet")]
public class SPCmdletGetSignInConfigObject : SPCmdlet
{
   private SPWebApplicationPipeBind m_webAppPipeBind;

   protected override void InternalProcessRecord()
   {
       SPWebApplication webApp = m_webAppPipeBind.Read();
       SignInConfiguration sc = webApp.GetChild<SignInConfiguration>("SignInConfig");
        
       if (sc == null)
       {
           sc = new SignInConfiguration("SignInConfig", webApp);
       }

       sc.Update();
       base.WriteObject(sc);
   }

   [ValidateNotNull]
   [Parameter(Mandatory=true, ValueFromPipeline=true, Position=0)]
   [Alias(new string[] { "WebApplication", "WebApp"})]
   public SPWebApplicationPipeBind Identity
   {
       get { return m_webAppPipeBind; }
       set { m_webAppPipeBind = value; }
   }
}

A SignInConfiguration object is returned for the specified web application. If the configuration does not exist yet a new one will be created. This gives us a reference to the SingInConfig object in the Powershell environment. Any changes are persisted after calling the Update() method on the object.

Finally, in the code behind of the login page the mappings are retrieved, the IP address of the request is checked against the mappings, and if an authentication provider is found the user is redirected to the provider’s sign-in page.

protected override void OnLoad(EventArgs e)
{
  if (SPContext.Current == null) return;
  if (SPContext.Current.Site == null) return;
  if (SPContext.Current.Site.WebApplication == null) return;

  SPWebApplication app = SPContext.Current.Site.WebApplication;
  SignInConfiguration config = app.GetChild<SignInConfiguration>("SignInConfig");

  SPAlternateUrl u = app.AlternateUrls[Request.Url];
  SPUrlZone zone = u.UrlZone;

  string components = Request.Url.GetComponents(UriComponents.Query, UriFormat.SafeUnescaped);
  SPIisSettings settings = app.IisSettings[zone];

  string ip = IpNetworking.GetIP4Address();
  ip = Regex.Replace(ip, @"^(?<Prefix>(\d{1,3}\.){3})\d{1,3}$", "${Prefix}*");
  if (config != null && config.ProviderMappings.ContainsKey(ip))
  {
      string targetProvider = config.ProviderMappings[ip];
      foreach (SPAuthenticationProvider provider in settings.ClaimsAuthenticationProviders)
      {
          if (string.Compare(provider.DisplayName, targetProvider, true, System.Globalization.CultureInfo.CurrentUICulture) == 0
              || string.Compare(provider.ClaimProviderName, targetProvider, true, System.Globalization.CultureInfo.CurrentUICulture) == 0)
          {
              string url = provider.AuthenticationRedirectionUrl.ToString();
              if (provider is SPWindowsAuthenticationProvider)
              {
                  components = EnsureReturnUrl(components);
              }
              SPUtility.Redirect(url, SPRedirectFlags.Default, this.Context, components);
          }
      }
  }
  else
  {
      SPUtility.Redirect("/_forms/default.aspx", SPRedirectFlags.Default, this.Context, components);   
  }
  base.OnLoad(e);
}
Posted by Mel Gerats | 2 Comments

May
05

SharePoint 2010: Social Features

Although Microsoft would claim that during the design process of SharePoint 2007 it invented social networking before Facebook and LinkedIn did, the times have changed somewhat since then and SharePoint 2007 wasnt really as social capable as we are now accustomed to.

In this post I would like to give an overview of all the cool new social features which I think will make SharePoint that much more interesting from a knowledge management perspective.

Tagging & Noteboard

In my previous post on SharePoint 2010 Term store and other metadata enhancements - Orbit One Blog I talked about the new tagging possibilities in SharePoint. The cool thing is that this functionality is present on all pages within SharePoint at the top right of the page.

image

So by clicking on these buttons you can quickly tag en note pages that you see within SharePoint but even nicer is to  put a button on your favorites bar to tag and note stuff on the internet as well

image

– Well for that just press the button once on a SharePoint page make the link on the screen a favorite.

image

image

The tagging function works with autocomplete which is nice and on the same screen you see recent activity on the item.

SharePoint profiles

Already since SharePoint 2003, users of SharePoint have had a profile with information about themselves. Normally these profiles get stale from the moment it got first updated on the first working day of a new employee :-)

The new version of SharePoint offers some new features that might be interesting in this respect:

Integration of the Microsoft Knowledge Network

The Microsoft Knowledge Network was introduced by Microsoft as an add-on for SharePoint 2007. It automates the discovery and sharing of undocumented knowledge and relationships, mining your communications for keywords and relationships within Outlook and updating your SharePoint profile accordingly. This way enabling you to quickly locate who knows whom and who knows what within your constantly changing organization.

image

Now the combination of Outlook 2010 and SharePoint 2010 gives you the opportunity to do just that out-of-the-box. It’s called Colleague and Outlook Social Connector

Sync SharePoint profile with other systems (social networks, Active Directory)

It is now possible to sync your SharePoint profile back to Active Directory including your profile picture. This way it will be easier to maintain data in your Active Directory. Another cool opportunity would be a Business Connectivity Services (BCS) connection that would sync your SharePoint profile with your profile on a social network, for instance LinkedIn?

 

So now that you are tagging, noting inside and outside of the firewall and your SharePoint profile is always up to date how will you other people within your organisation benefit from all this data?

Newsfeed

Well with a newsfeed just like you have on common social network sites:

image

Within your profile you can set the types of updates you want to get in your newsfeed. See the following screenshot for the out-of-the-box settings. Developers can customize the activities that can be followed so you can track custom actions happening in SharePoint as well.

image

That is it for the new and interesting social networking features in SharePoint.

Posted by Thijs ter Beek | Leave your feedback

May
03

The New World of Work (Het Nieuwe Werken) @ Orbit One

Concept

image

The New World of Work is a new flexible way of working and collaborating with co-workers, partners, customers etc. This new kind of working is funded on three pillars: People & Organisation, The Office and ICT.

People & Organisation

In order to stay competitive organisations need to hire and retain the best staff. To be an attractive employer for talent you need to challenge them and make them responsible for the results they deliver. In this culture of openness Managers control less and support more.

ICT

ICT is the underlying enabler of the “New World of Work” because it makes it possible for people to work from anywhere, at any time, with anybody. We use solutions as video conferencing, presence and virtual workspaces on a daily basis and feel it is key for working in the “New World of Work” 

The Office – Workplace

The office & its workplaces need to invite and stimulate people to perform different types of work in the most effective and pleasurable way. People spend more and more time collaborating with others (co-workers, partners or customers) so setup workspaces specific for these types of activity: meetings, brainstorms, video conferences, chats and of course some relax spaces to play and have fun.

Orbit One and The New World of Work

Within Orbit One we wanted to know where we stand in ‘the new world of work’ so we did a survey originally created by Dik Bijl in Dutch and translated it into English because in our team of 17 enthusiastic employees that is the working language :-)

If you want to do the survey yourself please download it and use the excel template analyzing the results.

 Culinair team at work by Orbit One.

Results

Here is a graph of the results of the survey focusing on the different aspects of ‘the new world of work’

Results survey new world of work

The results of the survey told us that we are doing reasonably well but as always there is room for improvement! We started on our physical work environment: The Office.

Come and experience One Office

With the survey in mind we started with the upgrade of our Office in Gent to be ready for the ‘New World of Work’.

We rent out part of our office so if you want to take advantage of this highly productive and fun working environment or if you just want to have peek inside, don’t be shy, come and visit us in Gent!

For more info on one office flexible workplaces see our website “One Office” Kenmerken

What can Orbit One offer you?

Orbit One is a Internet Solutions provider that assists clients in becoming more efficient using technologies such as: SharePoint, Office Communications Server (OCS), Exchange, Direct Access and SSL VPN. With these technologies we create an integrated environment for your people (employees, partners and customers) that simply works and will boosts their productivity!

Find out more in our presentation on slideshare

image

image

Downloads and other related stuff

If you’re interested contact us we can give a presentation/demo of how we work in the new world of work and how we can make you work more productive as well

Posted by Thijs ter Beek | Leave your feedback

Apr
21

SharePoint 2010: Term store and other metadata enhancements

The long expected successor of MOSS 2007, SharePoint 2010 will launch on May 12. We are all very excited about this! The last couple of months we have been working with the new version and we would like to give you an overview of the key new features regarding metadata and classification.

In the coming weeks we will dive deeper into other aspects of the platform: Search, Social Features, Offline access and Workflow.

Term store

The Term store is a service application that can be setup to manage metadata across farms, web applications and site collections.

Taxonomy and Folksonomy

Within the term store metadata can be managed top-down (taxonomy) or bottom-up (folksonomy). This means that an organisation can have an official taxonomy but at the same time provide users with the ability to add free tags to content as they please. Another cool thing about this is that you can ‘upgrade’ terms from the folksonomy to the taxonomy!

Hierarchical terms

The terms within the term store can be hierarchical in nature: For instance Regions and countries form a hierarchical structure. When people tag a specific item within SharePoint with Bermuda you can find it under Caribbean or Americas as well.

Hierarchical metadata

Management of terms

Each set of terms has an owner. He or she can maintain the terms and other people can give suggestions on synonyms or missing terms directly via the user interface. This makes SharePoint a very user friendly tool for managing metadata.

Autocomplete on terms and tags

When typing a term users get an autocomplete functionality to guide them to already used tags and the predefined taxonomy.

clip_image002

Content type hub

With the term store it is possible to reuse content types across site collections, web applications and even farms. This way policies and workflows can be forced on content across the enterprise which is key in larger organisations. To start using this functionality you need to set up a site collection as your content type hub. In this site collection you’ll maintain your enterprise wide content types. Other sites can use the content types created there.

Other enhancements to metadata usage

Metadata navigation

When browsing libraries or lists users can use key filters and metadata navigation to quickly find the right document within the library. This functionality makes folders look so 2009 ;-)

clip_image003

Facetted Search

Known already from addons like Codeplex’s MOSS Faceted Search or Surfray’s Ontolica Search for SharePoint this feature creates dynamic filters based on your search result which make it easy for end users to refine their search based on metadata properties.

image

Validation based on Excel based formulas

SharePoint 2010 makes it possible to validate data coming into SharePoint. The user will be instructed on what specific rules a certain property needs to comply to be saved to SharePoint. The formulas describing the rules are based on Excel logic.

image

That's it for now. Stay tuned for more good SharePoint 2010 stuff!

Posted by Thijs ter Beek | 1 Comment

May
04

Language sensitive search results in SharePoint

 

The Problem:

SharePoint returns different search results when I change my browser language

Searching for "the" in English will give no results because the word is ignored. 

Search results in English

Searching for "the" in Dutch does give results.

 Search results in Dutch

This is a feature of SharePoint, it's not a bug.

However, it's not always desirable behaviour. In a multi-lingual site with a variation for each language the search results should be in the language of the current variation.

By default SharePoint will ignore the variation settings and still take the browser language.

There are several posts with the same problem, here and herehere. The suggested solutions range from changing the browser language programmatically to creating a new masterpage with the Culture hard coded, to subclassing the search results web part and changing the Culture settings in the OnInit event.

Unfortunately these solutions either do not work or require a lot of work for a simple change.

The solution:

The Search Core Results web part has a property called "SearchLanguage", which holds the locale of the search results. By default this property is null, and the locale will be inferred from the browser language

To set this property to your language of choice, export the Search Core Results web part.

Towards the end of the file you'll find the property QueryLanguage, which is null by default:

<property name="QueryLanguage" type="string" null="true" />
 

Change this to

<property name="QueryLanguage" type="string">en-GB</property>
 

Now import the web part back to the page and remove the old Search Core Results web part.

The search results will now always be in the language you chose, no matter what the browser language is.

Posted by Mel Gerats | 1 Comment

Mar
28

Preserve created and modified information when importing a document in SharePoint.

I’m currently writing a web service on our SharePoint server to upload documents because one of our clients would like to migrate from a third party document management system to SharePoint.

This client would like to keep the legacy dates like the date of creation and the last modified date. After researching this, I still couldn’t find a way to do this. I noticed there are tools out there are able to do this so it is definitely possible.

So after some more trial and error I finally figured it out. And it wasn’t even that exotic, so I’d like to share how it is done.

When you’ve uploaded the file and checked it in you can change the dates with the following code:

public void UpdateFileDates(
string siteCollectionUrl, string site, 
string file, DateTime created, DateTime modified)
{
    if (siteCollectionUrl == null) 
       throw new ArgumentNullException("siteCollectionUrl");
 
    using (var spSite = new SPSite(siteCollectionUrl))
    using (var web = string.IsNullOrEmpty(site)
                        ? spSite.RootWeb
                        : spSite.OpenWeb(site))
    {
        var spFile = web.GetFile(file);
        if (spFile != null)
        {
            spFile.CheckIn("");
            var item = spFile.Item;
 
            if (item != null)
            {
            item["Created"] = created;
            item["Modified"] = modified;
 
            spFile.CheckOut();
            item.Update();
            //When you do overwritecheckin the 
	   // version doesn't change.
            spFile.CheckIn("", SPCheckinType.OverwriteCheckIn);
            }
        }
    }
}
Posted by Wim De Coninck | 1 Comment

Feb
27

Public website for EU Issue Tracker

EU Issue Tracker
 
Today we have launched the new website for EU Issue Tracker, the online service to anticipate, monitor and manage EU Legislation & Policy.
 
The site is completely developed using Microsoft SharePoint, and integrates with data from the back-end databases.
 
 
 
Posted by Olivier Mangelschots | Leave your feedback

Feb
11

Orbit One @ European SharePoint Best Practices Conference

From 6 to 8 April there is a very interesting conference in London.

Some very known speakers will be there: Joel Oleson, Andrew Connell, Ben Curry, Bob Fox, Eric Schupps, John Timney, …

The same conference was organized in San Diego, California begin February 2009.

They promise it's not a typical "blabla" conference, the point is to go beyond introductions and focus on best practices gathered by on-the-field experience.

Agenda http://www.sharepointbestpractices.co.uk/Agenda.html

From Joel's blog:

Joel Oleson

"I think the main difference that really stands out to me on this conference vs other SharePoint conferences is the prescriptive nature of the content, with the real world, case study and experience based emphasis. Speakers are grilled on making sure you cover the true WHY and not focus so much on HOW TO. The content is scrubbed to encourage depth and thought in WHY something should be done or not done."

Orbit One will be there!

Viktor, Mel, Rik, Bart and Olivier will join the conference in London. Are you coming too?
Let us know so we can have a beer!

Posted by Olivier Mangelschots | Leave your feedback

Feb
04

New portal www.iec-iab.be has been launched

IAB
 
On February 3rd, 2009 we have proudly launched a new website portal for the Institute of Accountants and Tax Consultants.
 
This large SharePoint portal has a public section and a password protected zone with information for the Institute members and internships.
 
Microsoft Dynamics CRM 4.0 is used as the central members' directory. It's integrated with SharePoint to provide an automated user account and permission management service.
 
Posted by Olivier Mangelschots | Leave your feedback

Nov
16

jQuery and Microsoft SharePoint

what is jQuery?

jQuery is a lightweight open source JavaScript library (only 15kb in size).

Just recently Microsoft and Nokia announced they will support the JQuery library in their products! Initially they wil integrate it in Visual Studio and use within Microsoft's ASP.NET AJAX framework and ASP.NET MVC Framework.

I'm currently integrating jQuery in MOSS 2007 sites. A first examples is our client pages. I will soon post some tips.  

SharePoint
JQuery

Posted by Bart De Jonge | Leave your feedback

Contact us - Raas Van Gaverestraat 83, 9000 Gent, Belgium - Tel. +32 (9) 330.15.00 - Privacy Statement - Sitemap - Sign In Developed with Microsoft Office SharePoint Server 2007