任何人都可以帮助将ASP.NET 4.5.2客户端迁移到核心2.0 [英] Can anyone help in migrating a ASP.NET 4.5.2 client to core 2.0

查看:68
本文介绍了任何人都可以帮助将ASP.NET 4.5.2客户端迁移到核心2.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我有一个Asp.Net 4.5.2 Web应用程序客户端,可以调用在我的服务器Core 2.0网站上运行的OAuth 2.0应用程序。它没有问题。



问题是当它从授权调用返回到服务器时,它不执行重定向URL中指定的返回方法。 br />


当我通过Visual Studio 2017调试器时,发送到服务器的授权字符串与我在.Net 4.5.2版本中运行它时的授权字符串相同客户端。



当它从.Net 4.5.2客户端的服务器返回时,它执行一个方法。



当它从.Net Core 2.0客户端中的服务器返回时,它不会执行该方法。它只是挂起而没有错误消息。



是否有人可以帮助我将我的Web客户端从Asp.Net 4.5.2迁移到Asp.Net Core 2.0 ?



如果有人能告诉我如何找出服务器返回客户端的内容,我将不胜感激。我无法弄清楚如何做到这一点。如果我知道的话,我或许可以知道是什么原因导致了挂断。



谢谢,

Tony



我尝试过的事情:



我已阅读过多份文件,其中不止一次, OAuth 2.0和路由以及与客户端相关的其他技术。



我用C#,Core 2.0代码创建了客户端应用程序,但无法让它按照工作方式运行.Net 4.5.2客户端。

Hello,

I have an Asp.Net 4.5.2 web application client that makes calls to a OAuth 2.0 application running on my server Core 2.0 website. It works without a problem.

The problem is when it returns from an authorization call to the server, it does not execute the return method specified in the redirect url.

When I take it through the Visual Studio 2017 debugger, the authorization string sent to the server is the same as when I run it in the .Net 4.5.2 version of the client.

When it returns from the server in the .Net 4.5.2 client, it executes a method.

When it returns from the server in the .Net Core 2.0 client, it does not executes that method. It just hangs up with no error message.

Is there anyone that can help me to migrate my web client from Asp.Net 4.5.2 to Asp.Net Core 2.0?

I would appreciate it if anyone can tell me how to find out what the server is returning to the client. I can't figure out how to do that. If I knew that, I might be able to know what is causing the hangup.

Thanks,
Tony

What I have tried:

I have read numerous documents, some more than once, on OAuth 2.0 and Routing and other technologies related to the client side.

I created the client application in C#, Core 2.0 code, but cannot get it to work the way the .Net 4.5.2 client does.

推荐答案

阅读以下内容:在ASP.NET Core 2.0中使用OAuth 2.0进行身份验证•Jerrie Pelser的博客 [ ^ ]
Read the following : Authenticate with OAuth 2.0 in ASP.NET Core 2.0 • Jerrie Pelser's Blog[^]


为解决此问题,我将此路由添加到Startup.cs文件中:

To fix this issue, I added this route to the Startup.cs file:
routes.MapRoute(
   name: "token",
   template: "token",
   defaults: new { controller = "API", action = "GetAccessToken" });


这篇关于任何人都可以帮助将ASP.NET 4.5.2客户端迁移到核心2.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆