# Player sign-in for webshops

> Understand how players are authenticated for a webshop and how sign-in links a persistent Unity Player Account to the player identity your game already uses.

Every player must be authenticated before they can buy from a webshop. Authentication connects each purchase to the same player identity your game uses.

Webshops use authentication and sign-in for different purposes:

* Authentication identifies the player who makes the purchase. When a player opens the webshop from your game, the game passes the player’s session to the shop. The player is authenticated automatically and doesn’t need to sign in.
* Sign-in lets an authenticated player link a persistent [Unity Player Account](/authentication/unity-player-accounts.md), such as Google, Apple, or email, to their existing player identity. Signing in doesn’t change the player identity. It adds a durable account to that identity.

For more information about the account system behind these flows, refer to [Unity Authentication](/authentication.md).

## Player authentication

When a player opens the webshop from the game, the game authenticates them automatically by passing the player’s session to the shop. The player doesn’t need to sign in.

If a player opens the webshop directly from a browser, bookmark, or shared link, the shop has no game session to authenticate them. The shop shows an unauthenticated landing page and prompts the player to open the shop from the game instead.

For more information, refer to [Open a webshop from your game](./deep-links.md#handle-the-unauthenticated-landing-page).

## Sign-in methods

When sign-in is available, webshops use Unity Player Accounts. Players can sign in with one of the following methods:

* A Google account.
* An Apple account.
* An email address verified by a one-time code.

You choose the sign-in methods that a webshop offers in the webshop's **Player authentication** settings.

> **Note:**
>
> You don't need to set up Unity Player Accounts before you create a webshop. Unity activates Player Accounts for the project automatically if it isn't already active. For more information, refer to [Create a webshop](./create-a-webshop.md#player-authentication-settings).

## Sign-in and purchases

Signing in doesn’t change which identity a purchase is attributed to. Webshops use the same player identity as your game. Receipt validation, entitlement grants, and order history use your existing [In-App Purchasing (IAP)](/iap.md) flows for that identity. A web purchase grants the same entitlement as an in-game purchase.

Signing in links a persistent Unity Player Account to the player’s identity. Once signed in, a player can return to the shop from a browser bookmark and the shop recognises their session automatically, without reopening the game. Players don’t need a separate web account, and sign-in isn’t required to buy when they open the shop from your game.
