> For the complete documentation index, see [llms.txt](https://docs.hyphen.at/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hyphen.at/flutter/authenticating-users.md).

# Authenticating Users

In Flutter, Hyphen Authentication functionalities are provided by the `authenticate` module of the SDK. This module enables users to perform various authentication tasks such as signing in, creating an account, and retrieving the user's key and account information.

### Integrate Hyphen Authenticate

The `HyphenAuthenticate` class provides functionalities for authentication using the Hyphen SDK.

* `getAccount`: Retrieves the user's account information.
* `authenticate`: Initiates the authentication process with the provided `webClientId`.

```dart
try {
  // Retrieve user's account information
  await HyphenAuthenticate.getAccount();

  // Authenticate user with webClientId
  await HyphenAuthenticate.authenticate("your_web_client_id");
} catch (e) {
  // Handle errors
  print("Error: $e");
}
```

### Authenticate with Google Account

{% hint style="info" %}
Currently, Hyphen SDK only supports authentication via **Google Account.**
{% endhint %}

You must use the Web Client ID on the Google Cloud Platform for Google Authentication. See also [Get your Google API client ID](https://developers.google.com/identity/gsi/web/guides/get-google-api-clientid).

```dart
HyphenAuthenticate.authenticate(
    webClientId = "<YOUR-WEB-CLIENT-ID>" // ex. 201778913659-dn4bo82q6hce3kfp7vstp04b22nh5hbi.apps.googleusercontent.com
)
```

Once authenticated successfully, you can get your HyphenAccount and retrieve information such as the account address.

```dart
final HyphenAccount hyphenAccount = await HyphenAuthenticate.getAccount();
if (hyphenAccount != null) {
  // Access the first address
  final String firstAddress = hyphenAccount.addresses.first.address;
  print("Address: $firstAddress"); // Print the first address
} 
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.hyphen.at/flutter/authenticating-users.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
