我相信这是基础内容,我可能遗漏了什么。我已经阅读了其他SO答案,谷歌搜索,阅读了资源,但我无法理解我需要做什么。
我正在尝试弄清楚如何编写一个连接到Twitch API的应用程序,具体来说是如何使用Twitch的API进行身份验证。他们的文档在这里:https://github.com/justintv/Twitch-API/blob/master/authentication.md 我创建了一个应用程序并存储了我的密钥。
现在,我想让我的用户单击一个按钮,启动他们网站上的身份验证。据我所知,我可以通过使用AccountManager来实现这一点。除了...我不知道该怎么做。
以下是我在网上找到的摘录:
根据Twitch的文档,我想将用户发送到:
我正在尝试弄清楚如何编写一个连接到Twitch API的应用程序,具体来说是如何使用Twitch的API进行身份验证。他们的文档在这里:https://github.com/justintv/Twitch-API/blob/master/authentication.md 我创建了一个应用程序并存储了我的密钥。
现在,我想让我的用户单击一个按钮,启动他们网站上的身份验证。据我所知,我可以通过使用AccountManager来实现这一点。除了...我不知道该怎么做。
以下是我在网上找到的摘录:
AccountManager am = AccountManager.get(this);
Bundle options = new Bundle();
am.getAuthToken(
myAccount_, // Account retrieved using getAccountsByType()
"Manage your tasks", // Auth scope
options, // Authenticator-specific options
this, // Your activity
new OnTokenAcquired(), // Callback called when a token is successfully acquired
new Handler(new OnError())); // Callback called if an error occurs
根据Twitch的文档,我想将用户发送到:
https://api.twitch.tv/kraken/oauth2/authorize
?response_type=code
&client_id=[your client ID]
&redirect_uri=[your registered redirect URI]
&scope=[space separated list of scopes]
&state=[your provided unique token]
我完全不知道这两件事情该如何结合在一起。