Search documentation of polar_express

# PolarExpress.Services.Oauth2Service (polar_express v0.1.5)

Copy Markdown View Source

Oauth2

Oauth2 API operations.

## Summary

### Functions

authorize(client, params \\ %{}, opts \\ [])

Authorize

create_client(client, params \\ %{}, opts \\ [])

Create Client

delete_client(client, client_id, params \\ %{}, opts \\ [])

Delete Client

get_client(client, client_id, params \\ %{}, opts \\ [])

Get Client

get_user_info(client, params \\ %{}, opts \\ [])

Get User Info

introspect_token(client, params \\ %{}, opts \\ [])

Introspect Token

request_token(client, params \\ %{}, opts \\ [])

Request Token

revoke_token(client, params \\ %{}, opts \\ [])

Revoke Token

update_client(client, client_id, params \\ %{}, opts \\ [])

Update Client

## Functions

# authorize(client, params \\ %{}, opts \\ [])

    @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(client, params \\ %{}, opts \\ [])

    @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(client, client_id, params \\ %{}, opts \\ [])

    @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(client, client_id, params \\ %{}, opts \\ [])

    @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(client, params \\ %{}, opts \\ [])

    @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(client, params \\ %{}, opts \\ [])

    @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(client, params \\ %{}, opts \\ [])

    @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(client, params \\ %{}, opts \\ [])

    @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(client, client_id, params \\ %{}, opts \\ [])

    @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.