# 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: 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://docs.hyphen.at/flutter/authenticating-users.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.
