> For the complete documentation index, see [llms.txt](https://docs.coherence.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coherence.io/1.4/hosting/coherence-cloud/coherence-cloud-apis/game-services/authentication-service-player-accounts.md).

# Authentication Service (Player Accounts)

By default, the **CloudService** will automatically authenticate as a Guest User, unless you disable *Auto Login As Guest* option in the CoherenceBridge inspector.

If you disable the automatic login, you can handle Player authentication manually through the **CloudService.GameServices.AuthService** API.

In this example, you can see how you can manually login as a Guest:

```csharp
using System.Threading.Tasks;
using Coherence.Cloud;
using Coherence.Toolkit;
using UnityEngine;

public class LoginAsGuestExample : MonoBehaviour
{
    public CoherenceBridge bridge;

    private CloudService cloudService;

    async void Start()
    {
        cloudService = bridge.CloudService;

        await Login();

        // At this point, we are ready to fully utilize the Cloud Service
    }

    private async Task Login()
    {
        var authService = cloudService.GameServices.AuthService;

        var result = await authService.LoginAsGuest();
        if (result.LoggedIn)
        {
            Debug.Log($"Logged in as: {result.Username}", this);
        }
        else
        {
            Debug.LogError(result, this);
        }
    }
}
```

You can also choose to allow your users to create their own Player accounts, you can use the Authentication Service API in a similar fashion to allow for manual authentication:

```csharp
using Coherence.Cloud;
using Coherence.Toolkit;
using System.Collections;
using UnityEngine;
using Result = Coherence.Runtime.Result;

using System.Threading.Tasks;
using Coherence.Cloud;
using Coherence.Toolkit;
using UnityEngine;

public class LoginAsUserExample : MonoBehaviour
{
    public CoherenceBridge bridge;

    public string username;
    public string password;

    private CloudService cloudService;

    async void Start()
    {
        cloudService = bridge.CloudService;

        await Login();

        // At this point, we are ready to fully utilize the Cloud Service
    }

    private async Task Login()
    {
        var authService = cloudService.GameServices.AuthService;

        var result = await authService.LoginWithPassword(username, password, true);
        if (result.LoggedIn)
        {
            Debug.Log($"Logged in as: {username}", this);
        }
        else
        {
            Debug.LogError(result, this);
        }
    }
}
```
