Configuring Facebook Authentication in SharePoint 2010

I got a task to configure Facebook Authentication couple of days back. I explored couple of blogs like PointBridge and Osnapz , they are good blog posts it give you an idea how to do that but overall i didn’t find anything like a step by step guide for those users who are doing it first time. Also when i started configuring Facebook Authentication i came across several issues which serves a lot of time and eventually my whole day was spent doing that. Therefore, i thought to make a blog entry which provides Step to Step guide for configuring Facebook Authentication in SharePoint 2010.

Following are the steps to configure Facebook Authentication for SharePoint sites.

Step 1: Download and Install Components

  1. Download and Install Windows Identity Framework SDK from http://www.microsoft.com/download/en/details.aspx?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3a+MicrosoftDownloadCenter+(Microsoft+Download+Center)&utm_content=Google+Reader&id=4451
  2. Download Json.Net from
    http://json.codeplex.com/

Step 2: Create a new ASP.Net website

  1. Open Visual Studio and click on File> New Website
  2. Specify Website Name and path to the folder where you want to store the website and click on OK
  3. It will create a new Website.
  4. Now associate a certificate with this Website and enable SSL.
  5. Open IIS Manager by typing inetmgr from the run option in windows OS.
  6. Open Server Certificates and click on Create Self-Signed Certificate.
  7.  

     

  8. Specify certificate friendly name, click OK.
  9.  

     

  10. Certificate will be created. Now associate this certificate to your Website
  11. Right click on the Server in IIS and click on Add Website. Specify Site Name and Physical Path, Select Port and click on Ok. Your website will be hosted on IIS.
  12. Select Website and click on Bindings from the left Panel.
  13. Click on Add and select the type ‘Https’ and specify any port by default it uses 443 but you can assign any other port as well. Select certificate you just created and click OK.
  14. Now the server certificate has been associated with your website.
  15. Export this certificate and save it somewhere in your system. We need this when running power shell scripts.
  16. Now Open Visual Studio and change the Sever settings in the Property Pages of the website.
  17. Right click on your website and click on Property Pages
  18. Go to the Startup Options and select Use custom server option and specify the Website URL that is hosted on IIS (Use SSL one).
  19. Now navigate to your website and test it should be in working state and there should not be any issue.
  20.  

 

Step 3: Create an STS Site from ASP.Net website

 

  1. Go to the Visual Studio and right click on the Website project and click on Add STS Reference
  2. It will pop up a Wizard window just click Next.
  3. In the next window select “Create a New STS Project in the current Solution”.
  4. Click on Finish.
  5. You will notice a new Website will be added in the solution.
  6. Now Open the IIS Manager and change the physical path to the newly STS website.
  7. Just click on Website in the IIS Manager
  8. Click on Basic Settings from the Right Panel in IIS Manager
  9. Specify new path and click OK.
  10. Now Test your STS website it should run without any issue.

Step 4: Create Application in Facebook

  1. Navigate to http://facebook.com/developers
  2. Sign in with your account
  3. Create new Application using Create New Application option
  4. Provide name
  5. Click ok It will create a new application
  6. Now Click on Edit Setting and Specify your ASP.Net site URL. We need to specify this so it will redirect it to the default.aspx after successful authentication.
  7. Note Application Id and Secret Key that we will reference in the ASP.Net code.
  8. Now we are ready to move next on Step 5.
  9.  

Step 5: Execute Scripts on Power Shell

Open SharePoint 2010 Management Shell and execute following scripts in order.

  1. $cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2(“c:\yourexported_cert.cer”)
  2. $map1 = New-SPClaimTypeMapping “http://schemas.xmlsoap.org/ws/2005/05/identity/claims/authentication” -IncomingClaimTypeDisplayName “FacebookID” –SameAsIncoming
  3. $map2 = New-SPClaimTypeMapping -IncomingClaimType “http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name” -IncomingClaimTypeDisplayName “Display Name” -LocalClaimType http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname
  4. $realm = “urn:researchfacebook.com:facebook” (Specify any urn but note it)
  5. $signinurl = https://localhost:4431/Website_STS/ (Your ASP.Net website address)
  6. New-SPTrustedIdentityTokenIssuer -Name “Facebook” -Description “Facebook custom STS” -Realm $realm -ImportTrustCertificate $cert -ClaimsMappings $map1,$map2 -SignInUrl $signinurl -IdentifierClaim $map1.InputClaimType
  7. New-SPTrustedRootAuthority -Name “Facebook custom STS token signing certificate” -Certificate $cert

 

Step 6: Modify Code and Edit Configuration file

1. Create a new oAuthFacebook.cs class and add it in the App_Code folder in the Website project.
Following is a code of oAuthFacebook.cs. Change the Yellow highlighted part according to your application.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Net;
using System.Collections.Specialized;
using System.IO;

///

/// Summary description for oAuthFacebook
///

public class oAuthFacebook
{
public enum Method { GET, POST };
public const string AUTHORIZE = “https://graph.facebook.com/oauth/authorize”;
public const string ACCESS_TOKEN = “https://graph.facebook.com/oauth/access_token”;
public const string CALLBACK_URL = “https://localhost:4431/Login.aspx”;

private string _consumerKey = “”;
private string _consumerSecret = “”;
private string _token = “”;

#region Properties

public string ConsumerKey
{
get
{
if (_consumerKey.Length == 0)
{
//Your application ID
_consumerKey = “000000000000000”;
}
return _consumerKey;
}
set { _consumerKey = value; }
}

public string ConsumerSecret
{
get
{
if (_consumerSecret.Length == 0)
{
//Your application secret key
_consumerSecret = “00000000000000000000000000000000”;
}
return _consumerSecret;
}
set { _consumerSecret = value; }
}

public string Token { get { return _token; } set { _token = value; } }

#endregion

///

/// Get the link to Facebook’s authorization page for this application.
///

/// The url with a valid request token, or a null string.
public string AuthorizationLinkGet()
{
return string.Format(“{0}?client_id={1}&redirect_uri={2}”, AUTHORIZE, this.ConsumerKey, CALLBACK_URL);
}

///

/// Exchange the Facebook “code” for an access token.
///

/// The oauth_token or “code” is supplied by Facebook’s authorization page following the callback.
public void AccessTokenGet(string authToken)
{
this.Token = authToken;
string accessTokenUrl = string.Format(“{0}?client_id={1}&redirect_uri={2}&client_secret={3}&code={4}”,
ACCESS_TOKEN, this.ConsumerKey, CALLBACK_URL, this.ConsumerSecret, authToken);

string response = WebRequest(Method.GET, accessTokenUrl, String.Empty);

if (response.Length > 0)
{
//Store the returned access_token
NameValueCollection qs = HttpUtility.ParseQueryString(response);

if (qs[“access_token”] != null)
{
this.Token = qs[“access_token”];
}
}
}

///

/// Web Request Wrapper
///

/// Http Method
/// Full url to the web resource
/// Data to post in querystring format
/// The web server response.
public string WebRequest(Method method, string url, string postData)
{

HttpWebRequest webRequest = null;
StreamWriter requestWriter = null;
string responseData = “”;

webRequest = System.Net.WebRequest.Create(url) as HttpWebRequest;
webRequest.Method = method.ToString();
webRequest.ServicePoint.Expect100Continue = false;
webRequest.UserAgent = “[You user agent]”;
webRequest.Timeout = 20000;

if (method == Method.POST)
{
webRequest.ContentType = “application/x-www-form-urlencoded”;

//POST the data.
requestWriter = new StreamWriter(webRequest.GetRequestStream());

try
{
requestWriter.Write(postData);
}
catch
{
throw;
}

finally
{
requestWriter.Close();
requestWriter = null;
}
}

responseData = WebResponseGet(webRequest);
webRequest = null;
return responseData;
}

///

/// Process the web response.
///

/// The request object.
/// The response data.
public string WebResponseGet(HttpWebRequest webRequest)
{
StreamReader responseReader = null;
string responseData = “”;

try
{
responseReader = new StreamReader(webRequest.GetResponse().GetResponseStream());
responseData = responseReader.ReadToEnd();
}
catch
{
throw;
}
finally
{
webRequest.GetResponse().GetResponseStream().Close();
responseReader.Close();
responseReader = null;
}

return responseData;
}
}

2. In this step we will replace the existing logic in the Login.aspx for Facebook Authentication
3. Open Login.aspx and replace with following code.

using System;
using System.Web.Security;
using System.Web;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
public partial class Login : System.Web.UI.Page
{
protected void Page_Load( object sender, EventArgs e )
{
string url = string.Empty;
oAuthFacebook fbAuth = new oAuthFacebook();

if (Request[“code”] == null)
{
// Response.Redirect(“http://www.google.com”);
if (Request.QueryString[“ReturnUrl”] != null)
HttpContext.Current.Session.Add(“OriginalQueryString”, Request.QueryString.ToString());

//Redirect the user back to Facebook for authorization.
Response.Redirect(fbAuth.AuthorizationLinkGet());
}
else
{
//Get the access token and secret.

fbAuth.AccessTokenGet(Request[“code”]);

if (fbAuth.Token.Length > 0)
{
url = “https://graph.facebook.com/me?fields=id,name,verified,picture&access_token=” + fbAuth.Token;
string json = fbAuth.WebRequest(oAuthFacebook.Method.GET, url, String.Empty);

Dictionary claims = GetClaims(json);
HttpContext.Current.Session.Add(“AuthClaims”, claims);

FormsAuthentication.SetAuthCookie(“Facebook Test”, false);
Response.Redirect(“default.aspx?” + HttpContext.Current.Session[“OriginalQueryString”]);
}
}
}

private Dictionary GetClaims(string json)
{
Dictionary claims = new Dictionary();
JObject profile = JObject.Parse(json);

string userID = profile[“id”].ToString().Replace(@””””, “”);
string name = profile[“name”].ToString().Replace(@””””, “”);
string verified = profile[“verified”].ToString().Replace(@””””, “”);
string picture = profile[“picture”].ToString().Replace(@””””, “”);

if (!String.IsNullOrEmpty(userID))
claims.Add(System.IdentityModel.Claims.ClaimTypes.Authentication, userID);
if (!String.IsNullOrEmpty(name))
claims.Add(System.IdentityModel.Claims.ClaimTypes.Name, name);
if (!String.IsNullOrEmpty(picture))
claims.Add(System.IdentityModel.Claims.ClaimTypes.Webpage, picture);

return claims;
}

}

4. In the CertificateUtil.cs I have changed the logic from comparing Subject Name with Friendly Name of the certificate. This is done because I have multiple self- signed certificates installed on my server and all having a same subject name i.e. machine name. So the only unique name I found was Friendly Name, that’s why I have changed it to Friendly Name.
public static X509Certificate2 GetCertificate( StoreName name, StoreLocation location, string subjectName )
{
X509Store store = new X509Store( name, location );
X509Certificate2Collection certificates = null;
store.Open( OpenFlags.ReadOnly );

try
{
X509Certificate2 result = null;

//
// Every time we call store.Certificates property, a new collection will be returned.
//
certificates = store.Certificates;

for ( int i = 0; i < certificates.Count; i++ )
{
X509Certificate2 cert = certificates[i];

if ( cert.FriendlyName.ToLower() == subjectName.ToLower() )
{
if ( result != null )
{
throw new ApplicationException( string.Format( "There are multiple certificates for subject Name {0}", subjectName ) );
}

result = new X509Certificate2( cert );
}
}

if ( result == null )
{
throw new ApplicationException( string.Format( "No certificate was found for subject Name {0}", subjectName ) );
}

return result;
}
finally
{
if ( certificates != null )
{
for ( int i = 0; i < certificates.Count; i++ )
{
X509Certificate2 cert = certificates[i];
cert.Reset();
}
}

store.Close();
}
}
}

5. GetScope Method of CustomTokenSecurityService.cs looks like following

protected override Scope GetScope( IClaimsPrincipal principal, RequestSecurityToken request )
{
// ValidateAppliesTo( request.AppliesTo );

//
// Note: The signing certificate used by default has a Distinguished name of "CN=STSTestCert",
// and is located in the Personal certificate store of the Local Computer. Before going into production,
// ensure that you change this certificate to a valid CA-issued certificate as appropriate.
//
Scope scope = new Scope( request.AppliesTo.Uri.OriginalString, SecurityTokenServiceConfiguration.SigningCredentials );
scope.TokenEncryptionRequired = false;
//Specify the Realm name as defined in the script in PowerShell.
if (scope.AppliesToAddress == "urn:fbauth.com:facebook")
{
//Specify the Web Application URL which has claim based authentication as Facebook as a Trusted provider.
scope.ReplyToAddress = "http://win-6rnn5tdp5c6:47213/_trust/&quot;;

}
else
{
scope.ReplyToAddress = scope.AppliesToAddress;
}
return scope;

}

6. In the Web.config file update the SigningCertificateName

 

 

Step 7: Create a New Web Application in SharePoint 2010

  1. Open Central Administration
  2. Click on Manage Web Applications
  3. Select New Web Application option from the Ribbon bar.
  4. In the New Web Application window select Claim Based as Authentication mode.

  5. Select Facebook as Trusted Identity Provider

  6. Click OK
  7. Now Once the Web Application is created we need to create a Site collection.
  8. Click on Create Site Collections under Site Collections
  9. Make sure your newly created Web Application is selected for which you are creating a site collection.
  10. Specify Title and select any template, In the Primary Site Collection Administrator select Browse people/group button.

 

  1. Select People window opens and there you will see Facebook in the left pane

     

     

  2. Now select Facebook and click on the search icon button to search. You will see one Facebook user will populate in the main pane.

     

     

  3. Select and click ok
  4. We are done now we will navigate to our Web Application and login with Facebook account.

[Hint]

 

 

 

Step 8: Navigating to SharePoint 2010 Site

 

  1. Navigate to your SharePoint site. It will show you the option to select Authentication type as Facebook and Windows Authentication.
  2. Just Select Facebook.

  3. As the certificate I have used is self- signed that’s why It will show some warning as below. Just click on Continue to the website and proceed.

  1. It will show the Facebook login page. Enter your user name and password and click on Sign In.

     

  2. It will show the Main SharePoint site Home page.

     

Note: One thing you want to do here is when you will login to your account first time with your Facebook Id you will be prompted Access Denied in SharePoint site and it will give show you the numeric ID of your Facebook Account that this does not have an access to your site. Just copy that ID and place it in any of the SharePoint User Groups of your Site Collection or even specify it as a Primary or Secondary Administrator just to test. Then now when you re login, it will show the main SharePoint site page.

150 thoughts on “Configuring Facebook Authentication in SharePoint 2010

  1. Thanks $author| you share some great -2 tactics, Thanks For Sharing all this and making it clear enough for any one to be able to grasp! I’ve Subscribed to your rss feed to Keep up to date, looking forword to your new posts!

  2. I visited a lot of website but I believe this one contains something extra in it. “A bore is a man who, when you ask him how he is, tells you.” by Bert Leston Taylor.

  3. I am now not sure where you are getting your information, however good topic. I needs to spend a while learning much more or figuring out more. Thanks for great information I was looking for this information for my mission.

  4. Hello are using WordPress for your blog platform? I’m new to the blog world but I’m trying to get started and set up my own. Do you need any html coding expertise to make your own blog? Any help would be greatly appreciated!

  5. Good post. I learn something more challenging and difficult on many blogs every single day. Most commonly it is stimulative to read content from different writers and practice a specific thing from their website. I’d prefer to use some articles on my blog if you don’t mind. Normally I’ll provide you a link . Thanks for sharing with us.

  6. Generally I don’t read article on blogs, however I wish to say that this write-up very compelled me to take a look at and do it! Your writing taste has been amazed me. Thanks, quite nice article.

  7. I was just searching for this info for some time. After 6 hours of continuous Googleing, finally I got it in your website. I wonder what is the lack of Google strategy that do not rank this type of informative websites in top of the list. Generally the top websites are full of garbage.

  8. Its fantastic as your other articles : D, appreciate it for posting . “Reason is the substance of the universe. The design of the world is absolutely rational.” by Georg Wilhelm Friedrich Hegel.

  9. Dead pent subject material, thank you for entropy. “He who establishes his argument by noise and command shows that his reason is weak.” by Michel de Montaigne.

  10. Thanks for the auspicious writeup. It in fact was a amusement account it. Look complex to more brought agreeable from you! However, how could we communicate?

  11. What’s Taking place i am new to this, I stumbled upon this I’ve found It absolutely useful and it has helped me out loads. I hope to give a contribution & help different users like its aided me. Great job.

  12. Wow! This could be one particular of the most helpful blogs We have ever arrive across on this subject. Basically Fantastic. I’m also a specialist in this topic therefore I can understand your effort.

  13. Pretty section of content. I just stumbled upon your site and in accession capital to assert that I get in fact enjoyed account your blog posts. Any way I will be subscribing to your feeds and even I achievement you access consistently quickly.

  14. I know this if off topic but I’m looking into starting my own weblog and was wondering what all is needed to get setup? I’m assuming having a blog like yours would cost a pretty penny? I’m not very internet savvy so I’m not 100% positive. Any recommendations or advice would be greatly appreciated. Many thanks

  15. I’ve recently started a blog, and the information you offer on this website has helped me greatly. Thank you for all of your time & work.

  16. Hello! I’ve been reading your web site for a long time now and finally got the bravery to go ahead and give you a shout out from Huffman Tx! Just wanted to tell you keep up the good job!

  17. Good blog! I really love how it’s easy on my eyes as well as the data are well written. I am wondering how I could be notified whenever a new post has been made. I have subscribed to your rss feed which should do the trick! Have a nice day!

  18. I was wondering if you ever considered changing the layout of your website? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having one or two images. Maybe you could space it out better?

  19. Howdy! Someone in my Myspace group shared this site with us so I came to take a look. I’m definitely loving the information. I’m bookmarking and will be tweeting this to my followers! Great blog and fantastic design and style.

  20. Today, while I was at work, my cousin stole my iphone and tested to see if it can survive a thirty foot drop, just so she can be a youtube sensation. My iPad is now broken and she has 83 views. I know this is completely off topic but I had to share it with someone!

  21. What i don’t understood is if truth be told how you are no longer really a lot more neatly-appreciated than you may be now. You are very intelligent. You realize therefore considerably relating to this topic, made me for my part believe it from a lot of numerous angles. Its like men and women are not involved unless it’s one thing to accomplish with Woman gaga! Your own stuffs excellent. Always care for it up!

  22. Between me and my husband we’ve owned more MP3 players over the years than I can count, including Sansas, iRivers, iPods (classic & touch), the Ibiza Rhapsody, etc. But, the last few years I’ve settled down to one line of players. Why? Because I was happy to discover how well-designed and fun to use the underappreciated (and widely mocked) Zunes are.

  23. After study a number of of the weblog posts in your web site now, and I truly like your method of blogging. I bookmarked it to my bookmark website checklist and can be checking back soon. Pls take a look at my site as properly and let me know what you think.

  24. Attractive section of content. I just stumbled upon your site and in accession capital to assert that I get actually enjoyed account your blog posts. Anyway I will be subscribing to your feeds and even I achievement you access consistently quickly.

  25. Have you ever ever considered including extra movies to your weblog posts to keep the readers more entertained? I imply I simply learn through the complete article of yours and it was quite good but since I am extra of a visual learner,I discovered that to be more useful properly let me know how it turns out! I really like what you guys are always up too. Such intelligent work and reporting! Sustain the good works guys I’ve added you guys to my blogroll. This is a nice article thanks for sharing this informative information.. I’ll go to your blog commonly for some latest post. Anyway, in my language, there usually are not much good source like this.

  26. It’s very helpful and encouraging, and i want to bookmark this webpage to be certain that potential customers is originating from your aspect and even more folks check out your blog.Maintain posting far more.

  27. I loved as much as you’ll receive carried out proper here. The comic strip is tasteful, your authored material stylish. nevertheless, you command get bought an shakiness over that you wish be handing over the following. ill indisputably come further before again since precisely the same nearly very ceaselessly inside case you shield this increase.

  28. Very nice post. I just stumbled upon your blog and wished to say that I’ve really enjoyed surfing around your blog posts. In any case I’ll be subscribing to your rss feed and I hope you write again very soon!

  29. I’ll gear this review to 2 types of people: current Zune owners who are considering an upgrade, and people trying to decide between a Zune and an iPod. (There are other players worth considering out there, like the Sony Walkman X, but I hope this gives you enough info to make an informed decision of the Zune vs players other than the iPod line as well.)

  30. Wonderful goods from you, man. I have understand your stuff previous to and you’re just extremely excellent. I really like what you’ve acquired here, really like what you’re saying and the way in which you say it. You make it entertaining and you still care for to keep it sensible. I cant wait to read much more from you. This is actually a tremendous web site.

  31. Thanks a lot for sharing this with all of us you actually understand what you are speaking approximately! Bookmarked. Kindly additionally visit my website =). We may have a link change contract between us!

  32. Fine Adept, what an exciting narrative. Easily hada blog We’d essentially blog about very much the same factors. Should you prefer a payday loan kindly visit

  33. When I originally commented I clicked the -Notify me when new comments are added- checkbox and now each time a comment is added I get four emails with the same comment. Is there any way you can remove me from that service? Thanks!

  34. Hiya! Fantastic blog! I happen to be a daily visitor to your site (somewhat more like addict 😛 ) of this website. Just wanted to say I appreciate your blogs and am looking forward for more to come!

  35. Excellent read, I simply passed this onto a colleague who was doing a little analysis on that. And he truly purchased me lunch as a result of I found it for him smile So let me rephrase that: Thanks for lunch! Anyway, in my language, there should not a lot good source like this.

  36. Hiya! Fantastic blog! I happen to be a daily visitor to your site (somewhat more like addict 😛 ) of this website. Just wanted to say I appreciate your blogs and am looking forward for more to come!

  37. I do not even know how I ended up here, but I thought this post was great. I don’t know who you are but certainly you’re going to a famous blogger if you aren’t already 😉 Cheers!

  38. Excellent read, I just passed this onto a friend who was doing some research on that. And he actually bought me lunch because I found it for him smile So let me rephrase that: Thanks for lunch! “We have two ears and one mouth so that we can listen twice as much as we speak.” by Epictetus.

  39. We wish to thank you yet again for the wonderful ideas you offered Jeremy when preparing a post-graduate research plus, most importantly, with regard to providing each of the ideas in a blog post. If we had been aware of your web page a year ago, we’d have been saved the unwanted measures we were choosing. Thank you very much.

  40. I wanted to develop a small note to say thanks to you for all of the fabulous guidelines you are giving at this website. My time intensive internet look up has at the end been recognized with extremely good tips to talk about with my two friends. I ‘d claim that many of us site visitors are truly blessed to exist in a notable place with many lovely individuals with very helpful guidelines. I feel extremely grateful to have come across your website page and look forward to really more fun minutes reading here. Thank you once more for a lot of things.

  41. I together with my guys were viewing the good advice from the blog and so then got a terrible suspicion I never expressed respect to the website owner for those techniques. Those women came as a result warmed to read them and have clearly been loving them. I appreciate you for turning out to be indeed thoughtful as well as for considering this form of useful issues most people are really needing to understand about. My sincere regret for not expressing gratitude to sooner.

  42. Do we need to add provider for Facebook in web.config of the webapplication , so that Facebook users apper in People picker?? I tried the same steps mentioned here but Facebook is not coming in the people picker.

    • Actually we cannot add facebook ids directly to sharepoint user groups to whom we want to give an access. Each facebook id have a numeric id in behind please see the “Note” section at the bottom of the blog to the problem i faced and then resolved. You can add that “numeric” id in the user group of sharepoint for permissions and access rights.

  43. Great work, Ovais. I tried following the steps but got stuck at creation of STS reference, because I kept getting “File not found exception (0x80070002). Any advise will be greatly appreciated. I am running on Windows Server 2008 R2.

    Thanks.
    Raj

  44. Great Article……..i follow those Step but i am stuck at one point, when we create website in IIS it cannot be browse or it give me error.

  45. Hi, This is a really nice post. it helps me to create an web application with trusted FB.
    But i am facing some difficulties.

    I am using ‘SharePoint 2010 Foundation’.
    In IIS I have created website “https://localhost:766”, and in my ASP .net code i have created STS website i make this as start up project when i run the site it gives me an address like “http://localhost:56833/WebLoginApps1_STS/” and directly redirect to FB login page.

    so at the time of power-shell command i used
    $signinurl = “http://localhost:56833/WebLoginApps1_STS/”
    and run the all commands.

    i have created web application from central admin and also Selects Facebook as Trusted Identity Provider.
    But at the time creating ‘site collection’ i cannot able to find the ‘Primary Site Collection Administrator’ of “Facebook”.

    • See when you login first time with your Facebook id it will give you some error message followed to some numeric id. So, then just logic with Windows Authentication and add that Id as secondary site collection or primary site collection Administrator. By default the access is denied. Once done, login again with your facebook id and you will pass through the authentication.

  46. Now i am created site collection with primary site collection Administrator as “admin”,
    but when i choose login with Facebook it will redirect me on FB’s login page which we want.
    but after login it will not showing me any error message. i will directly jump to my Facebook account.

  47. Hey, I found Error in Default.aspx page
    Error : The action ” (Request.QueryString[‘wa’]) is unexpected. Expected actions are: ‘wsignin1.0’ or ‘wsignout1.0’.
    In the following line of code. :
    WSFederationConstants.Actions.SignOut ) );
    }
    }
    catch ( Exception exception )

    can you please help me to solve this.

    • You might be doing something wrong.. please go through to the article carefully… many guys have successfully implemented following this article without getting any such error. I can help you out but please go through the article once again…

  48. When I changed phyhsical path to STS-website’s path and clicked on the test connection, I received a warning message saying; “Cannot verify access to path”.How can I solve this?

  49. Hi,

    in Step 3: Create an STS Site from ASP.Net website, when I click “Finish” I get an exception saying: The system cannot find the file specified. (Exception from HRESULT: 0x80070002.
    I don’t know what I could do to fix the problem

  50. Thanks for the walk-through.
    I have no problem with the ASP.net site with sts and integrated with facebook.
    But when I have confiugred the facebook authentication for sharepoint i am receiving an error stating “ID4220: The SAML Assertion is either not signed or the signature’s KeyIdentifier cannot be resolved to a SecurityToken. Ensure that the appropriate issuer tokens are present on the token resolver. To handle advanced token resolution requirements, extend Saml11TokenSerializer and override ReadToken.”

    Can you please tell if there are some settings I have to do on sharepoint to resolve this error.

  51. Appreciating the time and energy you put into your site and
    detailed information you offer. It’s great to come across a blog every once
    in a while that isn’t the same out of date rehashed information.
    Fantastic read! I’ve saved your site and
    I’mincluding your RSS feweds too my Googlpe account.

Leave a comment