このクラスではOAuth の署名を生成するツールが使用できます。
継承元 | NSObject |
宣言場所 | TWTROAuthSigning.h |
TWTROAuthSigningThis class provides tools to generate OAuth signatures.
|
– initWithAuthConfig:authSession:
– init
– OAuthEchoHeadersForRequestMethod:URLString:parameters:error:
– OAuthEchoHeadersToVerifyCredentials
TasksInitialization
OAuth Echo
|
Instance Methods |
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 エコーについての詳細情報
OAuthEchoHeadersForRequestMethod:URLString:parameters:error:OAuth Echo is a means to securely delegate OAuth authorization to a third party while interacting with an API. For example, you may wish to verify a user’s credentials from your app’s server (the third party) rather than your app. This method provides you with the OAuth signature to add to the third party’s request to This is equivalent to calling - (NSDictionary *)OAuthEchoHeadersForRequestMethod:(NSString *)method URLString:(NSString *)URLString parameters:(NSDictionary *)parameters error:(NSError **)error Parametersmethod
URLString
parameters
error
Return Value
See AlsoMore information about OAuth Echo |
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.
OAuthEchoHeadersToVerifyCredentialsThis method provides you with the OAuth signature, as well as the formed URL with the query string, to send a request to - (NSDictionary *)OAuthEchoHeadersToVerifyCredentials Return ValueA dictionary with the fully formed Request URL under See AlsoMore information about OAuth Echo and Verify Credentials |
使用できません。代わりに initWithAuthConfig:authSession: を使用してください。
- (instancetype)init
initUnavailable. Use initWithAuthConfig:authSession: instead.
|
OAuth の署名を生成するのに必要なパラメータを渡して、TWTROAuthSigning
オブジェクトのインスタンスを作成します。.
- (instancetype)initWithAuthConfig:(TWTRAuthConfig *)authConfig authSession:(id<TWTRAuthSession>)authSession
authConfig
(必須) Twitter アプリケーションの認証に必要な資格情報を内部に保持する。
authSession
(必須) ユーザーセッションに関連する資格情報を内部に保持する。
初期化されたTWTROAuthSigning
オブジェクト、もしくはパラメータが設定されていなかった場合はnil
。
TWTRAuthConfig、 TWTRSession 、DGTSessionに関する詳細情報
initWithAuthConfig:authSession:Instantiate a - (instancetype)initWithAuthConfig:(TWTRAuthConfig *)authConfig authSession:(id<TWTRAuthSession>)authSession ParametersauthConfig
authSession (required) Encapsulated credentials associated with a user session. Return ValueAn initialized See AlsoMore information about TWTRAuthConfig, TWTRSession and DGTSession |