# `Polarex.Oauth2`
[🔗](https://github.com/giusdp/polarex/blob/main/lib/polarex/operations/oauth2.ex#L1)

Provides API endpoints related to oauth2

# `oauth2_authorize`

```elixir
@spec oauth2_authorize(opts :: keyword()) ::
  {:ok,
   Polarex.AuthorizeResponseOrganization.t() | Polarex.AuthorizeResponseUser.t()}
  | :error
```

Authorize

# `oauth2_clients_oauth2_create_client`

```elixir
@spec oauth2_clients_oauth2_create_client(
  body :: Polarex.OAuth2ClientConfiguration.t(),
  opts :: keyword()
) :: {:ok, map()} | {:error, Polarex.HTTPValidationError.t()}
```

Create Client

Create an OAuth2 client.

## Request Body

**Content Types**: `application/json`

# `oauth2_clients_oauth2_delete_client`

```elixir
@spec oauth2_clients_oauth2_delete_client(client_id :: String.t(), opts :: keyword()) ::
  {:ok, map()} | {:error, Polarex.HTTPValidationError.t()}
```

Delete Client

Delete an OAuth2 client.

# `oauth2_clients_oauth2_get_client`

```elixir
@spec oauth2_clients_oauth2_get_client(client_id :: String.t(), opts :: keyword()) ::
  {:ok, map()} | {:error, Polarex.HTTPValidationError.t()}
```

Get Client

Get an OAuth2 client by Client ID.

# `oauth2_clients_oauth2_update_client`

```elixir
@spec oauth2_clients_oauth2_update_client(
  client_id :: String.t(),
  body :: Polarex.OAuth2ClientConfigurationUpdate.t(),
  opts :: keyword()
) :: {:ok, map()} | {:error, Polarex.HTTPValidationError.t()}
```

Update Client

Update an OAuth2 client.

## Request Body

**Content Types**: `application/json`

# `oauth2_introspect_token`

```elixir
@spec oauth2_introspect_token(
  body :: Polarex.IntrospectTokenRequest.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.IntrospectTokenResponse.t()} | :error
```

Introspect Token

Get information about an access token.

## Request Body

**Content Types**: `application/x-www-form-urlencoded`

# `oauth2_request_token`

```elixir
@spec oauth2_request_token(
  body ::
    Polarex.AuthorizationCodeTokenRequest.t()
    | Polarex.RefreshTokenRequest.t()
    | Polarex.WebTokenRequest.t(),
  opts :: keyword()
) :: {:ok, Polarex.TokenResponse.t()} | :error
```

Request Token

Request an access token using a valid grant.

## Request Body

**Content Types**: `application/x-www-form-urlencoded`

# `oauth2_revoke_token`

```elixir
@spec oauth2_revoke_token(body :: Polarex.RevokeTokenRequest.t(), opts :: keyword()) ::
  {:ok, map()} | :error
```

Revoke Token

Revoke an access token or a refresh token.

## Request Body

**Content Types**: `application/x-www-form-urlencoded`

# `oauth2_userinfo`

```elixir
@spec oauth2_userinfo(opts :: keyword()) ::
  {:ok, Polarex.UserInfoOrganization.t() | Polarex.UserInfoUser.t()} | :error
```

Get User Info

Get information about the authenticated user.

---

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