ベアラトークンのモデル作成。その他
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include <cocoatweet/api/oauth1/requestToken.h>
|
||||
#include <cocoatweet/util/util.h>
|
||||
#include <iostream>
|
||||
#include <cocoatweet/authentication/oauth.h>
|
||||
|
||||
namespace CocoaTweet::API::OAuth1 {
|
||||
RequestToken::RequestToken() {
|
||||
@@ -14,8 +15,12 @@ void RequestToken::oauthCallback(const std::string& _oauthCallback) {
|
||||
|
||||
CocoaTweet::API::Model::OAuthToken RequestToken::process(
|
||||
std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth) {
|
||||
auto key = oauth_.lock()->key();
|
||||
key.authType(CocoaTweet::Authentication::Key::AUTH_TYPE::OAUTH10A);
|
||||
auto oauth = std::make_shared<CocoaTweet::Authentication::OAuth1>(key);
|
||||
|
||||
CocoaTweet::API::Model::OAuthToken oauthToken;
|
||||
HttpPost::process(_oauth, [&oauthToken](const std::string& _rcv) {
|
||||
HttpPost::process(oauth, [&oauthToken](const std::string& _rcv) {
|
||||
auto mp = CocoaTweet::Util::parse(_rcv, '&', '=');
|
||||
if (mp.count("oauth_token")) {
|
||||
oauthToken.oauthToken(mp.at("oauth_token"));
|
||||
|
||||
Reference in New Issue
Block a user