# `AttestoClient.UserInfo`
[🔗](https://github.com/XukuLLC/attesto_client/blob/v2.26.0/lib/attesto_client/user_info.ex#L1)

Verify signed OpenID Connect UserInfo responses.

This verifier covers OIDC Core §5.3.2 signed UserInfo responses: it verifies
the authorization server signature, requires `iss` and `aud` to identify the
issuer and relying party, and returns the string-keyed claims. When the caller
supplies `:id_token_sub`, the UserInfo `sub` must match the ID Token subject.

# `error`

```elixir
@type error() ::
  :missing_issuer
  | :missing_client_id
  | :invalid_jwks
  | :invalid_metadata
  | :issuer_mismatch
  | :unsupported_alg
  | :invalid_token
  | :invalid_signature
  | :ambiguous_key
  | :weak_key
  | :unsupported_critical_header
  | :unexpected_typ
  | :invalid_issuer
  | :invalid_audience
  | :invalid_claims
  | :sub_mismatch
  | :expired
  | :invalid_iat
  | :invalid_nbf
  | :not_yet_valid
  | AttestoClient.Discovery.error()
```

# `jwks`

```elixir
@type jwks() :: %{optional(String.t()) =&gt; term()} | [map()] | map()
```

# `verify_opt`

```elixir
@type verify_opt() ::
  {:issuer, String.t()}
  | {:client_id, String.t()}
  | {:id_token_sub, String.t()}
  | {:jwks, jwks()}
  | {:metadata, map()}
  | {:jwks_uri, String.t()}
  | {:accepted_algs, [Attesto.SigningAlg.alg()]}
  | {:now, integer() | DateTime.t()}
  | {:req_options, keyword()}
  | {:well_known, AttestoClient.Discovery.well_known()}
```

# `verify`

```elixir
@spec verify(String.t(), [verify_opt()]) :: {:ok, map()} | {:error, error()}
```

Verify a signed UserInfo JWT.

Required options: `:issuer` and `:client_id`. Pass `:id_token_sub` to bind the
UserInfo response back to a previously verified ID Token.

`:outbound` applies to the metadata and JWKS fetches made when no `:jwks` is
given; see `AttestoClient.Outbound`. A malformed value is
`{:error, :invalid_outbound}`.

---

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