Interface IAuthentication
VRoid SDK OAuth authentication interface
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
Client
Declaration
Client Client { get; }
Property Value
Type | Description |
---|---|
Client |
Methods
AuthorizeWithExistAccount(Action<Boolean>, Action<HttpRequestFailedException>)
Authenticate with account existing on device
Declaration
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
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 |
CreateAuthorizedHttpConnection(String, HTTPMethod, IHttpParam, Dictionary<String, String>)
Create IHttp Connection for running HTTP request
Declaration
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
void Init(AuthenticateMetaData metaData)
Parameters
Type | Name | Description |
---|---|---|
AuthenticateMetaData | metaData | Application-specific settings for using VRoid SDK |
Init(AuthenticateMetaData, IHttpConnectionDriver)
Initialize
Declaration
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
bool IsAuthorized()
Returns
Type | Description |
---|---|
Boolean | Returns |
Logout()
Log out
Declaration
void Logout()
OnCompleteBrowseAuthorize()
Callback when browser authentication completed
Declaration
void OnCompleteBrowseAuthorize()
RefreshExistAccountForce(Action<Boolean>, Action<HttpRequestFailedException>)
Force refresh account that exists on device
Declaration
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
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 |