我有一个Web应用程序,其中任何用户如果选择社交媒体自动化,如Twitter,他们点击Twitter按钮并完成oauth过程。这个oauth过程是使用php完成的。LinqToTwitter多个用户授权者
我在数据库中存储该特定用户的oauth标记和oauth密钥。
现在我有四个按键:
ConsumerKey // common for all as it is the key of app in dev.twitter.com
ConsumerSecret // common for all as it is the secret of app in dev.twitter.com
OauthToken //store in database, which keeps on changing as other user activates the socia media
OauthTokenSecret //store in database, which keeps on changing
我已经应用了所有授权技术象下面这样:
var auth = new MvcAuthorizer
{
Credentials = new InMemoryCredentials
{
ConsumerKey = "###################",
ConsumerSecret = "##################",
OAuthToken = token,
AccessToken = secret
}
};
auth.Authorize();
var auth = new SingleUserAuthorizer
{
Credentials = new InMemoryCredentials
{
ConsumerKey = "###############",
ConsumerSecret = "#############################",
OAuthToken = token,
AccessToken = secret
}
};
auth.Authorize();
的问题是,如果我进入该网站上提供的令牌和秘密dev.twitter.com一切正常,但如果我提供存储在数据库中的令牌和秘密它不认证用户。
如果我用什么不同的accessToken和秘密每次。它会认证吗? –
,因为令牌和秘密因不同用户而异。当我提供这个令牌和秘密时,它给我403错误,如果我提供的网站dev.twitter.com上有我的应用程序的令牌和秘密,它工作正常,但只有一个用户凭据 –
对于用户,你可以也使用PinAuthorizer并提供所有4个标记。 –