Class Authentication
[to be removed] Singleton class for carrying out OAuth authentication with VRoid Hub
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
Client
Declaration
public Client Client { get; }
Property Value
| Type | Description |
|---|---|
| Client |
Instance
IAuthentication singleton
Declaration
public static IAuthentication Instance { get; }
Property Value
| Type | Description |
|---|---|
| IAuthentication |
Methods
AuthorizeWithExistAccount(Action<Boolean>, Action<HttpRequestFailedException>)
Authenticate with account existing on device
Declaration
public void AuthorizeWithExistAccount(Action<bool> onExistAccountAuthSuccess, Action<HttpRequestFailedException> onAuthError)
Parameters
| Type | Name | Description |
|---|---|---|
| Action<Boolean> | onExistAccountAuthSuccess | Success callback |
| Action<HttpRequestFailedException> | onAuthError | Failure callback |
BrowserAuthorized(String, String, String, Action<Boolean>)
Get OAuth token
Declaration
public string BrowserAuthorized(string redirectUri, string scope, string codeChallenge, Action<bool> onRegistered)
Parameters
| Type | Name | Description |
|---|---|---|
| String | redirectUri | URI to receive authentication code |
| String | scope | Authentication scope |
| String | codeChallenge | code_challenge for PKCE |
| Action<Boolean> | onRegistered | Success callback |
Returns
| Type | Description |
|---|---|
| String | State for CSRF prevention |
Remarks
codeChallenge remains to maintain computer compatibility
CreateAuthorizedHttpConnection(String, HTTPMethod, IHttpParam, Dictionary<String, String>)
method remains to maintain computer compatibility
Declaration
public IHttpConnection CreateAuthorizedHttpConnection(string requestPath, HTTPMethod method, IHttpParam param, Dictionary<string, string> headers)
Parameters
| Type | Name | Description |
|---|---|---|
| String | requestPath | Request path |
| HTTPMethod | method | HTTP method |
| IHttpParam | param | HTTP request parameter |
| Dictionary<String, String> | headers | HTTP request header |
Returns
| Type | Description |
|---|---|
| IHttpConnection | IHttpConnection to run HTTP request |
Init(AuthenticateMetaData)
Initialize
Declaration
public void Init(AuthenticateMetaData metaData)
Parameters
| Type | Name | Description |
|---|---|---|
| AuthenticateMetaData | metaData | Application-specific settings for using VRoid SDK |
Init(AuthenticateMetaData, IHttpConnectionDriver)
Initialize
Declaration
public void Init(AuthenticateMetaData metaData, IHttpConnectionDriver driver)
Parameters
| Type | Name | Description |
|---|---|---|
| AuthenticateMetaData | metaData | Application-specific settings for using VRoid SDK |
| IHttpConnectionDriver | driver | Factory interface to create IHttpConnection |
IsAuthorized()
Is authenticated or not
Declaration
public bool IsAuthorized()
Returns
| Type | Description |
|---|---|
| Boolean | Returns |
Logout()
Log out
Declaration
public void Logout()
OnCompleteBrowseAuthorize()
Callback when browser authentication completed
Declaration
public void OnCompleteBrowseAuthorize()
Remarks
Authentication will not be called
RefreshExistAccountForce(Action<Boolean>, Action<HttpRequestFailedException>)
Force refresh account that exists on device
Declaration
public void RefreshExistAccountForce(Action<bool> onExistAccountAuthSuccess, Action<HttpRequestFailedException> onAuthError)
Parameters
| Type | Name | Description |
|---|---|---|
| Action<Boolean> | onExistAccountAuthSuccess | Success callback |
| Action<HttpRequestFailedException> | onAuthError | Failure callback |
RegisterCode(String, String, String)
Register authentication code
Declaration
public void RegisterCode(string oauthCode, string redirectUri, string codeVerifier)
Parameters
| Type | Name | Description |
|---|---|---|
| String | oauthCode | Authentication code |
| String | redirectUri | URL to receive authentication code |
| String | codeVerifier | code_verifier for PKCE |
Remarks
redirectUri, or codeVerifier are left to maintain computer compatibility