Class Authentication
[廃止予定] VRoid HubとOAuth認証を行うためのシングルトンクラス
Implements
Inherited Members
Namespace: Pixiv.VroidSdk.Unity.Oauth.Legacy
Assembly: Pixiv.VroidSdk.Unity.dll
Syntax
[Obsolete("Authentication is deprecated. Please use Oauth.Client")]
public class Authentication : IAuthentication
Properties
Client
クライアント
Declaration
public Client Client { get; }
Property Value
| Type | Description |
|---|---|
| Client |
Instance
IAuthenticationのシングルトン
Declaration
public static IAuthentication Instance { get; }
Property Value
| Type | Description |
|---|---|
| IAuthentication |
Methods
AuthorizeWithExistAccount(Action<Boolean>, Action<HttpRequestFailedException>)
デバイスに存在するアカウントで認可する
Declaration
public 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
public 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 |
Remarks
codeChallengeは互換性維持のために残している
CreateAuthorizedHttpConnection(String, HTTPMethod, IHttpParam, Dictionary<String, String>)
methodは互換性維持のために残している
Declaration
public 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
public void Init(AuthenticateMetaData metaData)
Parameters
| Type | Name | Description |
|---|---|---|
| AuthenticateMetaData | metaData | VRoid SDKを使用するためのアプリケーション固有設定 |
Init(AuthenticateMetaData, IHttpConnectionDriver)
初期化
Declaration
public void Init(AuthenticateMetaData metaData, IHttpConnectionDriver driver)
Parameters
| Type | Name | Description |
|---|---|---|
| AuthenticateMetaData | metaData | VRoid SDKを使用するためのアプリケーション固有設定 |
| IHttpConnectionDriver | driver | IHttpConnectionを作成するファクトリインターフェース |
IsAuthorized()
認可されているか
Declaration
public bool IsAuthorized()
Returns
| Type | Description |
|---|---|
| Boolean | 認可されていれば |
Logout()
ログアウトする
Declaration
public void Logout()
OnCompleteBrowseAuthorize()
ブラウザ認証が完了した場合のコールバック
Declaration
public void OnCompleteBrowseAuthorize()
Remarks
Authenticationにおいては呼び出されることはない
RefreshExistAccountForce(Action<Boolean>, Action<HttpRequestFailedException>)
デバイスに存在するアカウントを強制的にリフレッシュする
Declaration
public void RefreshExistAccountForce(Action<bool> onExistAccountAuthSuccess, Action<HttpRequestFailedException> onAuthError)
Parameters
| Type | Name | Description |
|---|---|---|
| Action<Boolean> | onExistAccountAuthSuccess | 成功コールバック |
| Action<HttpRequestFailedException> | onAuthError | 失敗コールバック |
RegisterCode(String, String, String)
認可コードを登録する
Declaration
public void RegisterCode(string oauthCode, string redirectUri, string codeVerifier)
Parameters
| Type | Name | Description |
|---|---|---|
| String | oauthCode | 認可コード |
| String | redirectUri | 認可コード受け取りURL |
| String | codeVerifier | PKCEにおけるcode_verifier |
Remarks
redirectUri及び、codeVerifierは互換性維持のために残している