简体   繁体   English

重定向到外部URL发布

[英]Redirect to external URL Post

I will try and keep this as short as possible, although I may be leaving some things out, due to inexperience and/or lack of knowledge. 尽管由于经验不足和/或缺乏知识,我可能会遗漏一些内容,但我会尽力使其尽可能简短。

I have successfully been able to redirect from Website A to Website B, much like what was illustrated in the link C# - HttpWebResponse redirect to external URL (Thank You to everyone involved, this was very helpful) 我已经能够成功地从网站A重定向到网站B,就像链接C#中的说明-HttpWebResponse重定向到外部URL (谢谢所涉及的每个人,这非常有帮助)

The only problem is, that in Website B, after the redirection seems to have been successful, the system seems to ignore what happened , and redirect again back to it's Default home controller index Get Action result, and continues to Log in as if the Redirection never took place. 唯一的问题是,在网站B中,重定向似乎成功之后,系统似乎忽略了所发生的情况,然后再次重定向回其默认的主控制器索引Get Action结果,并继续以重定向的方式登录从来没有发生。 I have removed everything that may cause this, in my opinion, like Attributes to check authentication etc. 我认为,我已删除可能导致此问题的所有内容,例如检查身份验证的属性等。

Any help in this regard will be much appreciated. 在这方面的任何帮助将不胜感激。

According to your reference link( https://stackoverflow.com/questions/27503986/c-sharp-httpwebresponse-redirect-to-external-url ), they try to create a single-sign-on system. 根据您的参考链接( https://stackoverflow.com/questions/27503986/c-sharp-httpwebresponse-redirect-to-external-url ),他们尝试创建一个单点登录系统。 Because they have 2 websites. 因为他们有2个网站。 The question of this link that how can they solve this problem with HtppWebRequest class. 他们如何用HtppWebRequest类解决此问题的链接问题。 This is not possible ofcourse. 当然这是不可能的。

If you look at the answer section that I added on image, Author offer to use cookie sharing. 如果您查看我在图像上添加的答案部分,那么作者将提供使用cookie共享的功能。

在此处输入图片说明

What is the correct solution to share authanctication info between different web site? 在不同的网站之间共享认证信息的正确解决方案是什么?

You should search about on Single Sing On Authantication methods. 您应该在“关于单一身份验证”方法上进行搜索。 Here is a few clue 这是一些线索

OAuth(Google, Facebook) OAuth(Google,Facebook)

SAML Protocol SAML协议

JWt W

may Jwt a bit hard way ;) 可能会有点困难;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM