使用linkedin验证应用程序时出错

时间:2015-12-14 19:50:37

标签: c# oauth xamarin oauth-2.0 linkedin

我在尝试使用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/")
  );

2 个答案:

答案 0 :(得分:1)

尝试一下这个:

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

答案 1 :(得分:0)

尝试对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