# `AshAuthentication.Strategy.OAuth2.IdentityChange`
[🔗](https://github.com/team-alembic/ash_authentication/blob/main/lib/ash_authentication/strategies/oauth2/identity_change.ex#L5)

Resolves and updates the user's identity when registering via OAuth2/OIDC.

Runs in two phases:

  * `before_action` - resolves *which* local user this sign-in belongs to,
    using the provider's `iss`/`sub` (never the email). See
    `AshAuthentication.Strategy.OAuth2.UserResolver` for the matching rules.
  * `after_action` - upserts the identity row for the resolved user so that
    future sign-ins with the same `iss`/`sub` resolve to them.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
