Object moved to here

Posted by Community Admin on 04-Aug-2018 07:39

Object moved to here

All Replies

Posted by Community Admin on 21-Oct-2015 00:00

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

This thread is closed