Search code examples
openidsitefinity

is there an existing openid implementation for sitefinity


I'm just wondering if anyone can point me in the right direction integrating openid with sitefinity for user creation / login for my sitefinity site.

Thanks


Solution

  • There's an open source widget you can get started with. By default it includes amazon, google, and facebook.

    https://github.com/Sitefinity/Sitefinity-External-STS-Integration

    You can also look into dotnetopenauth to implement your own. For example, loggin in with twitter you could create a widget that implements something like this (this is MVC which you can use in Sitefinity or you could do something similar on a button click and !IsPostback in webforms user controls.

        public ActionResult Login(string id)
        {
            string url = Request.Url.AbsoluteUri;
            if (Request.QueryString["oauth_token"] != null)
            {
                string screenName;
                int userId;
                string profileImage;
                if (TwitterConsumer.TryFinishSignInWithTwitter(out screenName, out userId))
                {
                    ViewBag.Message = screenName;
                    ViewBag.UserId = userId;
                   //do claims or forms auth method here.
                }
            }
            else
            {
                if (id == "twitter")
                {
                    TwitterConsumer.StartSignInWithTwitter(false).Send();
                }
            }
            return View();
        }
    

    I hope this helps.