# Authenticator

```
class UniversalAuthenticatorLibrary::Authenticator
  : public MonoBehaviour
```

## Summary

| Members                                                                                                                                                                                                                                                                                                                                                                                                                                 | Descriptions                                                                                                                                                                                                                                                                                                                   |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `public` [`Authenticator`](#class_universal_authenticator_library_1_1_authenticator_1ab23c9931185b7d2ed1df846304565bc0)`(` [`Chain`](https://liquiidio.gitbook.io/unity-plugin-suite/universalauthenticatorlibrary/api-docs/universalauthenticatorlibrary-chain)`chain,` [`UALOptions`](https://liquiidio.gitbook.io/unity-plugin-suite/universalauthenticatorlibrary/api-docs/universalauthenticatorlibrary-ualoptions) `options)`     |                                                                                                                                                                                                                                                                                                                                |
| `public virtual void` [`Init`](#class_universal_authenticator_library_1_1_authenticator_1ad02d0bc6712c0142357ea28c901b540f)`(` [`Chain`](https://liquiidio.gitbook.io/unity-plugin-suite/universalauthenticatorlibrary/api-docs/universalauthenticatorlibrary-chain)`chain,` [`UALOptions`](https://liquiidio.gitbook.io/unity-plugin-suite/universalauthenticatorlibrary/api-docs/universalauthenticatorlibrary-ualoptions) `options)` |                                                                                                                                                                                                                                                                                                                                |
| `public` [`ButtonStyle`](https://liquiidio.gitbook.io/unity-plugin-suite/universalauthenticatorlibrary/api-docs/universalauthenticatorlibrary-buttonstyle) [`GetStyle`](#class_universal_authenticator_library_1_1_authenticator_1a04a22cff21dcd15b98988b0fe7969afc)`()`                                                                                                                                                                | Returns the style of the Button that will be rendered.                                                                                                                                                                                                                                                                         |
| `public virtual bool` [`ShouldRender`](#class_universal_authenticator_library_1_1_authenticator_1a96f5bfb6c43d5aca41afa153d45848a7)`()`                                                                                                                                                                                                                                                                                                 |                                                                                                                                                                                                                                                                                                                                |
| `public virtual bool` [`ShouldAutoLogin`](#class_universal_authenticator_library_1_1_authenticator_1aa6e79d162791d7d72273fc93d99388dd)`()`                                                                                                                                                                                                                                                                                              | Returns whether or not the dapp should attempt to auto login with the Authenticator app. Auto login will only occur when there is only one Authenticator that returns shouldRender() true and shouldAutoLogin() true.                                                                                                          |
| `public uint` [`ShouldInvalidateAfter`](#class_universal_authenticator_library_1_1_authenticator_1a5af01a96359ca8f539098eef54da4519)`()`                                                                                                                                                                                                                                                                                                | Returns the amount of seconds after the authentication will be invalid for logging in on new browser sessions. Setting this value to zero will cause users to re-attempt authentication on every new browser session. Please note that the invalidate time will be saved client-side and should not be relied on for security. |
| `public virtual Task<` [`User`](https://liquiidio.gitbook.io/unity-plugin-suite/universalauthenticatorlibrary/api-docs/universalauthenticatorlibrary-user)`>` [`Login`](#class_universal_authenticator_library_1_1_authenticator_1a2a72d1cb495b8c2ef24da6b411a6c4f6)`(string accountName)`                                                                                                                                              | \*\*                                                                                                                                                                                                                                                                                                                           |
| `public virtual Task` [`Logout`](#class_universal_authenticator_library_1_1_authenticator_1a8a97cbd434878195ddb345d3ecc5c6d3)`()`                                                                                                                                                                                                                                                                                                       | Logs the user out of the dapp. This will be strongly dependent on each Authenticator app's patterns.                                                                                                                                                                                                                           |
| `private uint` [`defaultInvalidateAfter`](#class_universal_authenticator_library_1_1_authenticator_1a816cf04c4c384c9c4ee110302a57912c)`= 604800`                                                                                                                                                                                                                                                                                        | Default value for shouldInvalidateAfter(), 1 week in seconds                                                                                                                                                                                                                                                                   |
| `private` [`ButtonStyle`](https://liquiidio.gitbook.io/unity-plugin-suite/universalauthenticatorlibrary/api-docs/universalauthenticatorlibrary-buttonstyle) [`ButtonStyle`](#class_universal_authenticator_library_1_1_authenticator_1a412d693877e4cb5f89501d2539b8b858)                                                                                                                                                                |                                                                                                                                                                                                                                                                                                                                |
| `private` [`Chain`](https://liquiidio.gitbook.io/unity-plugin-suite/universalauthenticatorlibrary/api-docs/universalauthenticatorlibrary-chain) [`Chain`](#class_universal_authenticator_library_1_1_authenticator_1ac5ae30619ab2ecd485d62c4a67082190)                                                                                                                                                                                  |                                                                                                                                                                                                                                                                                                                                |
| `private` [`UALOptions`](https://liquiidio.gitbook.io/unity-plugin-suite/universalauthenticatorlibrary/api-docs/universalauthenticatorlibrary-ualoptions) [`Options`](#class_universal_authenticator_library_1_1_authenticator_1a225bcd4e4908f06b1dfadbb0c04821c2)                                                                                                                                                                      |                                                                                                                                                                                                                                                                                                                                |

## Members

**`public`** [**`Authenticator`**](#class_universal_authenticator_library_1_1_authenticator_1ab23c9931185b7d2ed1df846304565bc0)**`(`** [**`Chain`**](https://liquiidio.gitbook.io/unity-plugin-suite/universalauthenticatorlibrary/api-docs/universalauthenticatorlibrary-chain)**`chain,`** [**`UALOptions`**](https://liquiidio.gitbook.io/unity-plugin-suite/universalauthenticatorlibrary/api-docs/universalauthenticatorlibrary-ualoptions) **`options)`**

**`public virtual void`** [**`Init`**](#class_universal_authenticator_library_1_1_authenticator_1ad02d0bc6712c0142357ea28c901b540f)**`(`** [**`Chain`**](https://liquiidio.gitbook.io/unity-plugin-suite/universalauthenticatorlibrary/api-docs/universalauthenticatorlibrary-chain)**`chain,`** [**`UALOptions`**](https://liquiidio.gitbook.io/unity-plugin-suite/universalauthenticatorlibrary/api-docs/universalauthenticatorlibrary-ualoptions) **`options)`**

**`public`** [**`ButtonStyle`**](https://liquiidio.gitbook.io/unity-plugin-suite/universalauthenticatorlibrary/api-docs/universalauthenticatorlibrary-buttonstyle) [**`GetStyle`**](#class_universal_authenticator_library_1_1_authenticator_1a04a22cff21dcd15b98988b0fe7969afc)**`()`**

Returns the style of the Button that will be rendered.

**`public virtual bool`** [**`ShouldRender`**](#class_universal_authenticator_library_1_1_authenticator_1a96f5bfb6c43d5aca41afa153d45848a7)**`()`**

**`public virtual bool`** [**`ShouldAutoLogin`**](#class_universal_authenticator_library_1_1_authenticator_1aa6e79d162791d7d72273fc93d99388dd)**`()`**

Returns whether or not the dapp should attempt to auto login with the Authenticator app. Auto login will only occur when there is only one Authenticator that returns shouldRender() true and shouldAutoLogin() true.

**`public uint`** [**`ShouldInvalidateAfter`**](#class_universal_authenticator_library_1_1_authenticator_1a5af01a96359ca8f539098eef54da4519)**`()`**

Returns the amount of seconds after the authentication will be invalid for logging in on new browser sessions. Setting this value to zero will cause users to re-attempt authentication on every new browser session. Please note that the invalidate time will be saved client-side and should not be relied on for security.

**`public virtual Task<`** [**`User`**](https://liquiidio.gitbook.io/unity-plugin-suite/universalauthenticatorlibrary/api-docs/universalauthenticatorlibrary-user)**`>`** [**`Login`**](#class_universal_authenticator_library_1_1_authenticator_1a2a72d1cb495b8c2ef24da6b411a6c4f6)**`(string accountName)`**

\*\*

**`public virtual Task`** [**`Logout`**](#class_universal_authenticator_library_1_1_authenticator_1a8a97cbd434878195ddb345d3ecc5c6d3)**`()`**

Logs the user out of the dapp. This will be strongly dependent on each Authenticator app's patterns.

**`private uint`** [**`defaultInvalidateAfter`**](#class_universal_authenticator_library_1_1_authenticator_1a816cf04c4c384c9c4ee110302a57912c)**`= 604800`**

Default value for shouldInvalidateAfter(), 1 week in seconds

**`private`** [**`ButtonStyle`**](https://liquiidio.gitbook.io/unity-plugin-suite/universalauthenticatorlibrary/api-docs/universalauthenticatorlibrary-buttonstyle) [**`ButtonStyle`**](#class_universal_authenticator_library_1_1_authenticator_1a412d693877e4cb5f89501d2539b8b858)

**`private`** [**`Chain`**](https://liquiidio.gitbook.io/unity-plugin-suite/universalauthenticatorlibrary/api-docs/universalauthenticatorlibrary-chain) [**`Chain`**](#class_universal_authenticator_library_1_1_authenticator_1ac5ae30619ab2ecd485d62c4a67082190)

**`private`** [**`UALOptions`**](https://liquiidio.gitbook.io/unity-plugin-suite/universalauthenticatorlibrary/api-docs/universalauthenticatorlibrary-ualoptions) [**`Options`**](#class_universal_authenticator_library_1_1_authenticator_1a225bcd4e4908f06b1dfadbb0c04821c2)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://liquiidio.gitbook.io/unity-plugin-suite/universalauthenticatorlibrary/api-docs/universalauthenticatorlibrary-authenticator.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
