# Battle.net Login

Allow players to log in to your Drupal site using their Battle.net accounts. Powered by OpenID Connect.

## Enable the module

```
drush en wow_battlenet_login -y
```

This also enables the [OpenID Connect](https://www.drupal.org/project/openid_connect) module as a dependency.

## Configure OpenID Connect

1. Go to **Administration > Configuration > People > OpenID Connect** (`/admin/config/people/openid-connect`).
2. Under **Enabled clients**, check **Battle.net**.
3. The Client ID and Secret are read from the core WoW module's configuration automatically — no need to enter them again.
4. Under **Settings** (`/admin/config/people/openid-connect/settings`):
    - Enable **Override registration settings** if your site restricts new account creation but you want Battle.net users to be able to sign up.
    - Configure **Button display** — the login button appears on the user login form.

## How it works

- When a player clicks "Log in with Battle.net", they are redirected to Blizzard's OAuth server.
- After authorizing, they are redirected back to your site.
- A Drupal account is created (or linked, if one already exists for that Battle.net account).
- The player's BattleTag is used as the Drupal username (e.g., `Player-1234`).

## Dashboard status

The WoW dashboard at `/admin/reports/wow` shows:

- **Linked accounts** — how many Drupal users have a Battle.net account linked.
- **Account registration** — whether new accounts can be created via Battle.net login, or if the setting is blocking signups.
