【问题标题】:Error while authenticating an app with linkedin使用linkedin 验证应用程序时出错
【发布时间】:2016-03-20 10:16:44
【问题描述】:

我在尝试使用 LinkedIn 进行身份验证时收到以下错误。 “无效的重定向 URI”

该链接是有效的,并且在开发者网站中的链接中注册了我的应用程序。

什么可能导致此错误?

  var auth = new OAuth2Authenticator
  (
     clientId: "MYID",
     scope: "r_basicprofile",
     authorizeUrl: new Uri("https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=MYID&redirect_uri=https://wicareerpathways.org/&state=987654321&scope=r_basicprofile"),              
     redirectUrl: new Uri("https://wicareerpathways.org/")
  );

【问题讨论】:

标签: c# oauth xamarin oauth-2.0 linkedin


【解决方案1】:

尝试在authorizeUrl中对redirect_url参数进行URL编码 -->

https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=MYID&redirect_uri=https%3A%2F%2Fwicareerpathways.org%2F&state=987654321&scope=r_basicprofile

【讨论】:

  • 我尝试将 uri 更改为 url ,但我得到一个不同的错误,它会闪烁数十次。身份验证错误 - “您通过了 ="response_type"+ more+than+once+this+can+only+apear+once。”
【解决方案2】:

试试这个:

var auth = new OAuth2Authenticator (
                clientId: "**",
                clientSecret:"**",
                scope: "r_fullprofile r_contactinfo",
                authorizeUrl: new Uri ("https://www.linkedin.com/uas/oauth2/authorization"),
                redirectUrl: new Uri ("http://www.***.co.nz/"),
                accessTokenUrl:new Uri("https://www.linkedin.com/uas/oauth2/accessToken")    
            );

参考: https://forums.xamarin.com/discussion/comment/49244/#Comment_49244

【讨论】:

    猜你喜欢
    • 2014-01-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-10
    • 2015-12-29
    • 2019-12-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多