Interface IAuthentication
VRoid SDKのOAuth認証インターフェース
Namespace: Pixiv.VroidSdk.Unity.Oauth.Legacy
Assembly: Pixiv.VroidSdk.Unity.dll
Syntax
[Obsolete("IAuthentication is deprecated. Please use Oauth.Client")]
public interface IAuthentication
Properties
Client
クライアント
Declaration
Client Client { get; }
Property Value
Type | Description |
---|---|
Client |
Methods
AuthorizeWithExistAccount(Action<Boolean>, Action<HttpRequestFailedException>)
デバイスに存在するアカウントで認可する
Declaration
void AuthorizeWithExistAccount(Action<bool> onExistAccountAuthSuccess, Action<HttpRequestFailedException> onAuthError)
Parameters
Type | Name | Description |
---|---|---|
Action<Boolean> | onExistAccountAuthSuccess | 成功コールバック |
Action<HttpRequestFailedException> | onAuthError | 失敗コールバック |
BrowserAuthorized(String, String, String, Action<Boolean>)
OAuthトークン取得を行う
Declaration
string BrowserAuthorized(string redirectUri, string scope, string codeChallenge, Action<bool> onRegistered)
Parameters
Type | Name | Description |
---|---|---|
String | redirectUri | 認可コードを受け取るURI |
String | scope | 認可スコープ |
String | codeChallenge | PKCEにおけるcode_challenge |
Action<Boolean> | onRegistered | 成功コールバック |
Returns
Type | Description |
---|---|
String | CSRF対策用state |
CreateAuthorizedHttpConnection(String, HTTPMethod, IHttpParam, Dictionary<String, String>)
HTTPリクエストを実行するためのIHttpConnectionを作成する
Declaration
IHttpConnection CreateAuthorizedHttpConnection(string requestPath, HTTPMethod method, IHttpParam param, Dictionary<string, string> headers)
Parameters
Type | Name | Description |
---|---|---|
String | requestPath | リクエストパス |
HTTPMethod | method | HTTPメソッド |
IHttpParam | param | HTTPリクエストパラメータ |
Dictionary<String, String> | headers | HTTPリクエストヘッダ |
Returns
Type | Description |
---|---|
IHttpConnection | HTTPリクエストを実行するためのIHttpConnection |
Init(AuthenticateMetaData)
初期化
Declaration
void Init(AuthenticateMetaData metaData)
Parameters
Type | Name | Description |
---|---|---|
AuthenticateMetaData | metaData | VRoid SDKを使用するためのアプリケーション固有設定 |
Init(AuthenticateMetaData, IHttpConnectionDriver)
初期化
Declaration
void Init(AuthenticateMetaData metaData, IHttpConnectionDriver driver)
Parameters
Type | Name | Description |
---|---|---|
AuthenticateMetaData | metaData | VRoid SDKを使用するためのアプリケーション固有設定 |
IHttpConnectionDriver | driver | IHttpConnectionを作成するファクトリインターフェース |
IsAuthorized()
認可されているか
Declaration
bool IsAuthorized()
Returns
Type | Description |
---|---|
Boolean | 認可されていれば |
Logout()
ログアウトする
Declaration
void Logout()
OnCompleteBrowseAuthorize()
ブラウザ認証が完了した場合のコールバック
Declaration
void OnCompleteBrowseAuthorize()
RefreshExistAccountForce(Action<Boolean>, Action<HttpRequestFailedException>)
デバイスに存在するアカウントを強制的にリフレッシュする
Declaration
void RefreshExistAccountForce(Action<bool> onExistAccountAuthSuccess, Action<HttpRequestFailedException> onAuthError)
Parameters
Type | Name | Description |
---|---|---|
Action<Boolean> | onExistAccountAuthSuccess | 成功コールバック |
Action<HttpRequestFailedException> | onAuthError | 失敗コールバック |
RegisterCode(String, String, String)
認可コードを登録する
Declaration
void RegisterCode(string oauthCode, string redirectUri, string codeVerifier)
Parameters
Type | Name | Description |
---|---|---|
String | oauthCode | 認可コード |
String | redirectUri | 認可コード受け取りURL |
String | codeVerifier | PKCEにおけるcode_verifier |