# `AshAuthentication.Strategy.KubernetesServiceAccount.IdentityMapper`
[🔗](https://git.jakeschurch.com/jake/ash_authentication_kubernetes/src/tag/v0.1.0/lib/ash_authentication/strategy/kubernetes_service_account/identity_mapper.ex#L1)

Maps a verified service-account identity to the actor's attributes.

Answer `{:ok, attributes}` (applied with `struct/2` to the resource) or
`:error` to refuse the identity (an authentication failure). Called on every
sign-in; keep it cheap.

# `identity`

```elixir
@type identity() :: %{
  namespace: String.t(),
  name: String.t(),
  username: String.t(),
  uid: String.t() | nil,
  audiences: [String.t()],
  expires_at: DateTime.t(),
  extra: map()
}
```

# `map_identity`

```elixir
@callback map_identity(
  identity(),
  AshAuthentication.Strategy.KubernetesServiceAccount.t()
) ::
  {:ok, map()} | :error
```

---

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