# `PolarExpress.Services.Oauth2Service`
[🔗](https://github.com/jeffhuen/polar_express/blob/main/lib/polar_express/services/oauth2_service.ex#L2)

Oauth2

Oauth2 API operations.

# `authorize`

```elixir
@spec authorize(PolarExpress.Client.t(), map(), keyword()) ::
  {:ok, PolarExpress.Schemas.AuthorizeResponseUser.t()}
  | {:error, PolarExpress.Error.t()}
```

Authorize

See `PolarExpress.Params.Oauth2AuthorizeParams` for parameter details.

# `create_client`

```elixir
@spec create_client(PolarExpress.Client.t(), map(), keyword()) ::
  {:ok, term()} | {:error, PolarExpress.Error.t()}
```

Create Client

Create an OAuth2 client.

See `PolarExpress.Params.Oauth2CreateClientParams` for parameter details.

# `delete_client`

```elixir
@spec delete_client(PolarExpress.Client.t(), String.t(), map(), keyword()) ::
  {:ok, term()} | {:error, PolarExpress.Error.t()}
```

Delete Client

Delete an OAuth2 client.

See `PolarExpress.Params.Oauth2DeleteClientParams` for parameter details.

# `get_client`

```elixir
@spec get_client(PolarExpress.Client.t(), String.t(), map(), keyword()) ::
  {:ok, term()} | {:error, PolarExpress.Error.t()}
```

Get Client

Get an OAuth2 client by Client ID.

See `PolarExpress.Params.Oauth2GetClientParams` for parameter details.

# `get_user_info`

```elixir
@spec get_user_info(PolarExpress.Client.t(), map(), keyword()) ::
  {:ok, PolarExpress.Schemas.UserInfoUser.t()}
  | {:error, PolarExpress.Error.t()}
```

Get User Info

Get information about the authenticated user.

See `PolarExpress.Params.Oauth2GetUserInfoParams` for parameter details.

# `introspect_token`

```elixir
@spec introspect_token(PolarExpress.Client.t(), map(), keyword()) ::
  {:ok, PolarExpress.Schemas.IntrospectTokenResponse.t()}
  | {:error, PolarExpress.Error.t()}
```

Introspect Token

Get information about an access token.

See `PolarExpress.Params.Oauth2IntrospectTokenParams` for parameter details.

# `request_token`

```elixir
@spec request_token(PolarExpress.Client.t(), map(), keyword()) ::
  {:ok, PolarExpress.Schemas.TokenResponse.t()}
  | {:error, PolarExpress.Error.t()}
```

Request Token

Request an access token using a valid grant.

See `PolarExpress.Params.Oauth2RequestTokenParams` for parameter details.

# `revoke_token`

```elixir
@spec revoke_token(PolarExpress.Client.t(), map(), keyword()) ::
  {:ok, PolarExpress.Schemas.RevokeTokenResponse.t()}
  | {:error, PolarExpress.Error.t()}
```

Revoke Token

Revoke an access token or a refresh token.

See `PolarExpress.Params.Oauth2RevokeTokenParams` for parameter details.

# `update_client`

```elixir
@spec update_client(PolarExpress.Client.t(), String.t(), map(), keyword()) ::
  {:ok, term()} | {:error, PolarExpress.Error.t()}
```

Update Client

Update an OAuth2 client.

See `PolarExpress.Params.Oauth2UpdateClientParams` for parameter details.

---

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