Asp.net mvc Asp.Net MVC:LinkedIn远程服务器返回错误:(401)未经授权
AuthConfig.csAsp.net mvc Asp.Net MVC:LinkedIn远程服务器返回错误:(401)未经授权,asp.net-mvc,linkedin,Asp.net Mvc,Linkedin,AuthConfig.cs public static class AuthConfig { public static void RegisterAuth() { OAuthWebSecurity.RegisterLinkedInClient( consumerKey: "xxxxxxxxxxx", consumerSecret: "xxxxxxxxxx");
public static class AuthConfig
{
public static void RegisterAuth()
{
OAuthWebSecurity.RegisterLinkedInClient(
consumerKey: "xxxxxxxxxxx",
consumerSecret: "xxxxxxxxxx");
OAuthWebSecurity.RegisterFacebookClient(
appId: "xxxxxxxxxx",
appSecret: "xxxxxxxxxxxxxxxxxxxx");
}
}
帐户控制器ExternalLoginCallback方法
public class AccountController : Controller
{
[AllowAnonymous]
public ActionResult ExternalLoginCallback(string returnUrl)
{
AuthenticationResult result = OAuthWebSecurity.VerifyAuthentication(Url.Action("ExternalLoginCallback", new { ReturnUrl = returnUrl })); ;
}
}
我收到以下错误:(401)未经授权(无论何时我从LinkedIn登录)。但是,对于facebook,它工作正常。请帮助我解决一些问题。这可以帮助您确定问题的根源 使用此OAuth测试控制台并将您正在生成的头与此工具生成的头进行比较:
如果你的头是错误的,那么LinkedIn将返回401状态我也有同样的问题。所以我检查了两件事,这帮我解决了问题
我希望这也能解决你的问题。有同样的问题。。