+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Object moved to here

Object moved to here

1 posts, 0 answered
  1. Ihar
    Ihar avatar
    4 posts
    Registered:
    17 Aug 2015
    21 Oct 2015
    Link to this post

    Hello,

    I have created a custom MVC widget (Hybrid MVC mode) that allows loggin in using Facebook, Twitter, Google. I use DotNetOpenAuth to implement it. But I get strange behavior when going redirect to registration page (i.e Facebook): appears  page with massage "Object moved to here" with link to loggin page instead direct redirecting.

    This is code

     

    public ActionResult ExternalLogin(SocialProvider provider, string returnUrl = "")
            {
                return new ExternalLoginResult(provider.ToString(), Url.Action("ExternalLoginCallback", new { ReturnUrl = returnUrl }));
            }
     
            internal class ExternalLoginResult : ActionResult
            {
                public ExternalLoginResult(string provider, string returnUrl)
                {
                    Provider = provider;
                    ReturnUrl = returnUrl;
                }
     
                public string Provider { get; private set; }
                public string ReturnUrl { get; private set; }
     
                public override void ExecuteResult(ControllerContext context)
                {
                    OAuthWebSecurity.RequestAuthentication(Provider, ReturnUrl);
                     
                }
            }
     
           public ActionResult ExternalLoginCallback(string returnUrl)
            {
                AuthenticationResult result = OAuthWebSecurity.VerifyAuthentication(Url.Action("ExternalLoginCallback", new { ReturnUrl = returnUrl }));
     
                if (!result.IsSuccessful)
                {
                    return RedirectToAction("Index");
                }
                else
                {
                 this.HandleSuccessfullOAuth(result);
                 return RedirectToReturnUrl();
                }
                 
     
            }

    Do you have any idea what is going on and how fix it?
    Thanks

1 posts, 0 answered