Polarex.Oauth2 (Polarex v0.3.1)

Copy Markdown View Source

Provides API endpoints related to oauth2

Summary

Functions

oauth2_authorize(opts \\ [])

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

Authorize

oauth2_clients_oauth2_create_client(body, opts \\ [])

@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(client_id, opts \\ [])

@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(client_id, opts \\ [])

@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(client_id, body, opts \\ [])

@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(body, opts \\ [])

@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(body, opts \\ [])

@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(body, opts \\ [])

@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(opts \\ [])

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

Get User Info

Get information about the authenticated user.