# `Backplane.Oauth.Validator`
[🔗](https://github.com/gsmlg-opt/backplane/blob/v1.10.77/apps/backplane_oauth/lib/backplane/oauth/validator.ex#L1)

Utility to validate the request according to the given parameters

# `validate`

```elixir
@spec validate(action :: :token | :authorize | :introspect | :revoke, params :: map()) ::
  {:ok, params :: map()} | {:error, message :: String.t()}
```

Validates given OAuth parameters.
## Examples
    iex> validate(:token, %{
      "grant_type" => "client_credentials",
      "client_id" => "client_id",
      "client_secret" => "client_secret"
    })
    {:ok, %{
      "grant_type" => "client_credentials",
      "client_id" => "client_id",
      "client_secret" => "client_secret"
    }}

    iex> validate(:authorize, %{})
    {:error, "Request is not a valid OAuth request. Need a response_type param."}

---

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