サイトのトップへ戻る

Twitter 開発者 ドキュメント日本語訳

TWTROAuthSigning

このクラスではOAuth の署名を生成するツールが使用できます。

継承元 NSObject
宣言場所 TWTROAuthSigning.h


タスク

初期化

– initWithAuthConfig:authSession:
– init

OAuth エコー

– OAuthEchoHeadersForRequestMethod:URLString:parameters:error:
– OAuthEchoHeadersToVerifyCredentials



インスタンスメソッド



OAuthEchoHeadersForRequestMethod:URLString:parameters:error:

OAuthエコーでは、APIとやり取りしている間のOAuth 認証をサードパーティへしっかりと任せます。 例えば、ユーザーの資格情報の検証をあなたのアプリからではなくあなたのサーバ(サードパーティ)から行いたいような場合です。

This method provides you with the OAuth signature to add to the third party’s request to URLString, as well as the formed URL with the query string to send that request to.

これは-URLRequestWithMethod:URL:parameters:error:を実行してURLと Authorization HTTP ヘッダを取得するのと同じことです。

- (NSDictionary *)OAuthEchoHeadersForRequestMethod:(NSString *)method URLString:(NSString *)URLString parameters:(NSDictionary *)parameters error:(NSError **)error
パラメータ

method

GET, POST, PUT, DELETE, などのリクエストメソッド。

URLString

リクエストを送信するTwitter エンドポイントのフルURL。例えばhttps://api.twitter.com/1.1/account/verify_credentials.json

parameters

リクエストパラメータ。

error

TWTRErrorDomain ドメインでのエラー。URLStringに設定したURLのホストがapi.twitter.comでない場合、このコードは TWTRErrorCodeInvalidURL になります。

戻り値

nil if there’s an error or a missing required parameter, or a dictionary with the fully formed request URL under TWTROAuthEchoRequestURLStringKey (NSString), and the Authorization header in TWTROAuthEchoAuthorizationHeaderKey (NSString), to be used to sign the request.

こちらも参照してください

OAuth エコーについての詳細情報



OAuthEchoHeadersToVerifyCredentials

This method provides you with the OAuth signature, as well as the formed URL with the query string, to send a request to verify_credentials.

- (NSDictionary *)OAuthEchoHeadersToVerifyCredentials
戻り値

A dictionary with the fully formed Request URL under TWTROAuthEchoRequestURLStringKey (NSString), and the Authorization header in TWTROAuthEchoAuthorizationHeaderKey (NSString), to be used to sign the request.

こちらも参照してください

OAuth エコー資格情報の検証についての詳細情報。



init

使用できません。代わりに initWithAuthConfig:authSession: を使用してください。

- (instancetype)init


initWithAuthConfig:authSession:

OAuth の署名を生成するのに必要なパラメータを渡して、TWTROAuthSigningオブジェクトのインスタンスを作成します。.

- (instancetype)initWithAuthConfig:(TWTRAuthConfig *)authConfig authSession:(id<TWTRAuthSession>)authSession
パラメータ

authConfig

(必須) Twitter アプリケーションの認証に必要な資格情報を内部に保持する。

authSession

(必須) ユーザーセッションに関連する資格情報を内部に保持する。

戻り値

初期化されたTWTROAuthSigning オブジェクト、もしくはパラメータが設定されていなかった場合はnil

こちらも参照してください

TWTRAuthConfigTWTRSessionDGTSessionに関する詳細情報