Packages

ory_client

0.2.0-alpha.29
1.22.63 1.22.62 1.22.61 1.22.60 1.22.59 1.22.58 1.22.57 1.22.56 1.22.55 1.22.54 1.22.53 1.22.52 1.22.51 1.22.50 1.22.49 1.22.48 1.22.47 1.22.46 1.22.45 1.22.44 1.22.43 1.22.42 1.22.41 1.22.40 1.22.39 1.22.38 1.22.37 1.22.36 1.22.35 1.22.34 1.22.33 1.22.32 1.22.28 1.22.27 1.22.26 1.22.25 1.22.24 1.22.23 1.22.22 1.22.21 1.22.16 1.22.15 1.22.14 1.22.13 1.22.12 1.22.11 1.22.10 1.22.9 1.22.8 1.22.7 1.22.6 1.22.5 1.22.4 1.22.3 1.22.2 1.22.1 1.22.0 1.21.6 1.21.5 1.21.4 1.21.3 1.21.2 1.21.1 1.21.0 1.20.23 1.20.22 1.20.11 1.20.10 1.20.9 1.20.8 1.20.7 1.20.6 1.20.5 1.20.4 1.20.3 1.20.2 1.20.1 1.20.0 1.19.0 1.18.5 1.18.4 1.17.2 1.17.1 1.16.10 1.6.2 1.6.1 1.5.2 1.5.1 1.5.0 1.4.9 1.4.8 1.4.7 1.4.6 1.4.5 1.4.4 1.4.3 1.4.2 1.4.1 1.4.0 1.3.0 1.2.17 1.2.16 1.2.15 1.2.14 1.2.11 1.2.10 1.2.9 1.2.8 1.2.7 1.2.6 1.2.5 1.2.4 1.2.3 1.2.2 1.2.1 1.2.0 1.1.51 1.1.50 1.1.49 1.1.48 1.1.47 1.1.46 1.1.45 1.1.44 1.1.41 1.1.40 1.1.39 1.1.39-alpha.0 1.1.38 1.1.37 1.1.36 1.1.35 1.1.34 1.1.33 1.1.32 1.1.31 1.1.30 1.1.29 1.1.28 1.1.27 1.1.26 1.1.25 1.1.24 1.1.23 1.1.22 1.1.21 1.1.20 1.1.19 1.1.18 1.1.17 1.1.7 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.2 1.0.1 1.0.0 1.0.0-alpha.0 0.2.0-alpha.60 0.2.0-alpha.48 0.2.0-alpha.47 0.2.0-alpha.46 0.2.0-alpha.45 0.2.0-alpha.44 0.2.0-alpha.43 0.2.0-alpha.42 0.2.0-alpha.41 0.2.0-alpha.40 0.2.0-alpha.39 0.2.0-alpha.38 0.2.0-alpha.37 0.2.0-alpha.36 0.2.0-alpha.35 0.2.0-alpha.34 0.2.0-alpha.33 0.2.0-alpha.32 0.2.0-alpha.31 0.2.0-alpha.30 0.2.0-alpha.29 0.2.0-alpha.28 0.2.0-alpha.27 0.2.0-alpha.26 0.2.0-alpha.25 0.2.0-alpha.24 0.2.0-alpha.23 0.2.0-alpha.22 0.2.0-alpha.21 0.2.0-alpha.20 0.2.0-alpha.19 0.2.0-alpha.18 0.2.0-alpha.16 0.2.0-alpha.15 0.2.0-alpha.14 0.2.0-alpha.4 0.2.0-alpha.2 0.1.0-alpha.12 0.1.0-alpha.11 0.1.0-alpha.10 0.1.0-alpha.9 0.1.0-alpha.8 0.1.0-alpha.7 0.1.0-alpha.6 0.1.0-alpha.5 0.1.0-alpha.4 0.1.0-alpha.3 0.1.0-alpha.2 0.1.0-alpha.1 0.0.1-alpha.189 0.0.1-alpha.188 0.0.1-alpha.187

OpenAPI API client for Ory Network, Ory's web-scale API for identity and access control.

Current section

Files

Jump to
ory_client lib ory api public.ex
Raw

lib/ory/api/public.ex

# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
# https://openapi-generator.tech
# Do not edit the class manually.
defmodule Ory.Api.Public do
@moduledoc """
API calls for all endpoints tagged `Public`.
"""
alias Ory.Connection
import Ory.RequestBuilder
@doc """
OpenID Connect Front-Backchannel Enabled Logout
This endpoint initiates and completes user logout at Ory Hydra and initiates OpenID Connect Front-/Back-channel logout: https://openid.net/specs/openid-connect-frontchannel-1_0.html https://openid.net/specs/openid-connect-backchannel-1_0.html Back-channel logout is performed asynchronously and does not affect logout flow.
## Parameters
- connection (Ory.Connection): Connection to server
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, nil} on success
{:error, Tesla.Env.t} on failure
"""
@spec disconnect_user(Tesla.Env.client, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
def disconnect_user(connection, _opts \\ []) do
%{}
|> method(:get)
|> url("/oauth2/sessions/logout")
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{ 302, false}
])
end
@doc """
OpenID Connect Discovery
The well known endpoint an be used to retrieve information for OpenID Connect clients. We encourage you to not roll your own OpenID Connect client but to use an OpenID Connect client library instead. You can learn more on this flow at https://openid.net/specs/openid-connect-discovery-1_0.html . Popular libraries for OpenID Connect clients include oidc-client-js (JavaScript), go-oidc (Golang), and others. For a full list of clients go here: https://openid.net/developers/certified/
## Parameters
- connection (Ory.Connection): Connection to server
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, Ory.Model.WellKnown.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec discover_open_id_configuration(Tesla.Env.client, keyword()) :: {:ok, Ory.Model.JsonError.t} | {:ok, Ory.Model.WellKnown.t} | {:error, Tesla.Env.t}
def discover_open_id_configuration(connection, _opts \\ []) do
%{}
|> method(:get)
|> url("/.well-known/openid-configuration")
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{ 200, %Ory.Model.WellKnown{}},
{ 401, %Ory.Model.JsonError{}},
{ 500, %Ory.Model.JsonError{}}
])
end
@doc """
Register an OAuth 2.0 Client using the OpenID / OAuth2 Dynamic Client Registration Management Protocol
This endpoint behaves like the administrative counterpart (`createOAuth2Client`) but is capable of facing the public internet directly and can be used in self-service. It implements the OpenID Connect Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint is disabled by default. It can be enabled by an administrator. Please note that using this endpoint you are not able to choose the `client_secret` nor the `client_id` as those values will be server generated when specifying `token_endpoint_auth_method` as `client_secret_basic` or `client_secret_post`. The `client_secret` will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somewhere safe.
## Parameters
- connection (Ory.Connection): Connection to server
- o_auth2_client (OAuth2Client):
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, Ory.Model.OAuth2Client.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec dynamic_client_registration_create_o_auth2_client(Tesla.Env.client, Ory.Model.OAuth2Client.t, keyword()) :: {:ok, Ory.Model.JsonError.t} | {:ok, Ory.Model.OAuth2Client.t} | {:error, Tesla.Env.t}
def dynamic_client_registration_create_o_auth2_client(connection, o_auth2_client, _opts \\ []) do
%{}
|> method(:post)
|> url("/connect/register")
|> add_param(:body, :body, o_auth2_client)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{ 201, %Ory.Model.OAuth2Client{}},
{ :default, %Ory.Model.JsonError{}}
])
end
@doc """
Deletes an OAuth 2.0 Client using the OpenID / OAuth2 Dynamic Client Registration Management Protocol
This endpoint behaves like the administrative counterpart (`deleteOAuth2Client`) but is capable of facing the public internet directly and can be used in self-service. It implements the OpenID Connect Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint is disabled by default. It can be enabled by an administrator. To use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query. If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header. OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
## Parameters
- connection (Ory.Connection): Connection to server
- id (String.t): The id of the OAuth 2.0 Client.
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, nil} on success
{:error, Tesla.Env.t} on failure
"""
@spec dynamic_client_registration_delete_o_auth2_client(Tesla.Env.client, String.t, keyword()) :: {:ok, nil} | {:ok, Ory.Model.JsonError.t} | {:error, Tesla.Env.t}
def dynamic_client_registration_delete_o_auth2_client(connection, id, _opts \\ []) do
%{}
|> method(:delete)
|> url("/connect/register/#{id}")
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{ 204, false},
{ :default, %Ory.Model.JsonError{}}
])
end
@doc """
Get an OAuth 2.0 Client using the OpenID / OAuth2 Dynamic Client Registration Management Protocol
This endpoint behaves like the administrative counterpart (`getOAuth2Client`) but is capable of facing the public internet directly and can be used in self-service. It implements the OpenID Connect Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint is disabled by default. It can be enabled by an administrator. To use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query. If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header. OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
## Parameters
- connection (Ory.Connection): Connection to server
- id (String.t): The id of the OAuth 2.0 Client.
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, Ory.Model.OAuth2Client.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec dynamic_client_registration_get_o_auth2_client(Tesla.Env.client, String.t, keyword()) :: {:ok, Ory.Model.JsonError.t} | {:ok, Ory.Model.OAuth2Client.t} | {:error, Tesla.Env.t}
def dynamic_client_registration_get_o_auth2_client(connection, id, _opts \\ []) do
%{}
|> method(:get)
|> url("/connect/register/#{id}")
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{ 200, %Ory.Model.OAuth2Client{}},
{ :default, %Ory.Model.JsonError{}}
])
end
@doc """
Update an OAuth 2.0 Client using the OpenID / OAuth2 Dynamic Client Registration Management Protocol
This endpoint behaves like the administrative counterpart (`updateOAuth2Client`) but is capable of facing the public internet directly and can be used in self-service. It implements the OpenID Connect Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint is disabled by default. It can be enabled by an administrator. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. To use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query. If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header. OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
## Parameters
- connection (Ory.Connection): Connection to server
- id (String.t): The id of the OAuth 2.0 Client.
- o_auth2_client (OAuth2Client):
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, Ory.Model.OAuth2Client.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec dynamic_client_registration_update_o_auth2_client(Tesla.Env.client, String.t, Ory.Model.OAuth2Client.t, keyword()) :: {:ok, Ory.Model.JsonError.t} | {:ok, Ory.Model.OAuth2Client.t} | {:error, Tesla.Env.t}
def dynamic_client_registration_update_o_auth2_client(connection, id, o_auth2_client, _opts \\ []) do
%{}
|> method(:put)
|> url("/connect/register/#{id}")
|> add_param(:body, :body, o_auth2_client)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{ 200, %Ory.Model.OAuth2Client{}},
{ :default, %Ory.Model.JsonError{}}
])
end
@doc """
The OAuth 2.0 Token Endpoint
The client makes a request to the token endpoint by sending the following parameters using the \"application/x-www-form-urlencoded\" HTTP request entity-body. > Do not implement a client for this endpoint yourself. Use a library. There are many libraries > available for any programming language. You can find a list of libraries here: https://oauth.net/code/ > > Do note that Hydra SDK does not implement this endpoint properly. Use one of the libraries listed above!
## Parameters
- connection (Ory.Connection): Connection to server
- grant_type (String.t):
- opts (KeywordList): [optional] Optional parameters
- :client_id (String.t):
- :code (String.t):
- :redirect_uri (String.t):
- :refresh_token (String.t):
## Returns
{:ok, Ory.Model.Oauth2TokenResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec oauth2_token(Tesla.Env.client, String.t, keyword()) :: {:ok, Ory.Model.JsonError.t} | {:ok, Ory.Model.Oauth2TokenResponse.t} | {:error, Tesla.Env.t}
def oauth2_token(connection, grant_type, opts \\ []) do
optional_params = %{
:client_id => :form,
:code => :form,
:redirect_uri => :form,
:refresh_token => :form
}
%{}
|> method(:post)
|> url("/oauth2/token")
|> add_param(:form, :grant_type, grant_type)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{ 200, %Ory.Model.Oauth2TokenResponse{}},
{ 400, %Ory.Model.JsonError{}},
{ 401, %Ory.Model.JsonError{}},
{ 500, %Ory.Model.JsonError{}}
])
end
@doc """
The OAuth 2.0 Authorize Endpoint
This endpoint is not documented here because you should never use your own implementation to perform OAuth2 flows. OAuth2 is a very popular protocol and a library for your programming language will exists. To learn more about this flow please refer to the specification: https://tools.ietf.org/html/rfc6749
## Parameters
- connection (Ory.Connection): Connection to server
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, nil} on success
{:error, Tesla.Env.t} on failure
"""
@spec oauth_auth(Tesla.Env.client, keyword()) :: {:ok, nil} | {:ok, Ory.Model.JsonError.t} | {:error, Tesla.Env.t}
def oauth_auth(connection, _opts \\ []) do
%{}
|> method(:get)
|> url("/oauth2/auth")
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{ 302, false},
{ 401, %Ory.Model.JsonError{}},
{ 500, %Ory.Model.JsonError{}}
])
end
@doc """
Revoke OAuth2 Tokens
Revoking a token (both access and refresh) means that the tokens will be invalid. A revoked access token can no longer be used to make access requests, and a revoked refresh token can no longer be used to refresh an access token. Revoking a refresh token also invalidates the access token that was created with it. A token may only be revoked by the client the token was generated for.
## Parameters
- connection (Ory.Connection): Connection to server
- token (String.t):
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, nil} on success
{:error, Tesla.Env.t} on failure
"""
@spec revoke_o_auth2_token(Tesla.Env.client, String.t, keyword()) :: {:ok, nil} | {:ok, Ory.Model.JsonError.t} | {:error, Tesla.Env.t}
def revoke_o_auth2_token(connection, token, _opts \\ []) do
%{}
|> method(:post)
|> url("/oauth2/revoke")
|> add_param(:form, :token, token)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{ 200, false},
{ 401, %Ory.Model.JsonError{}},
{ 500, %Ory.Model.JsonError{}}
])
end
@doc """
OpenID Connect Userinfo
This endpoint returns the payload of the ID Token, including the idTokenExtra values, of the provided OAuth 2.0 Access Token. For more information please [refer to the spec](http://openid.net/specs/openid-connect-core-1_0.html#UserInfo). In the case of authentication error, a WWW-Authenticate header might be set in the response with more information about the error. See [the spec](https://datatracker.ietf.org/doc/html/rfc6750#section-3) for more details about header format.
## Parameters
- connection (Ory.Connection): Connection to server
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, Ory.Model.UserinfoResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec userinfo(Tesla.Env.client, keyword()) :: {:ok, Ory.Model.UserinfoResponse.t} | {:ok, Ory.Model.JsonError.t} | {:error, Tesla.Env.t}
def userinfo(connection, _opts \\ []) do
%{}
|> method(:get)
|> url("/userinfo")
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{ 200, %Ory.Model.UserinfoResponse{}},
{ 401, %Ory.Model.JsonError{}},
{ 500, %Ory.Model.JsonError{}}
])
end
@doc """
JSON Web Keys Discovery
This endpoint returns JSON Web Keys to be used as public keys for verifying OpenID Connect ID Tokens and, if enabled, OAuth 2.0 JWT Access Tokens. This endpoint can be used with client libraries like [node-jwks-rsa](https://github.com/auth0/node-jwks-rsa) among others.
## Parameters
- connection (Ory.Connection): Connection to server
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, Ory.Model.JsonWebKeySet.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec well_known(Tesla.Env.client, keyword()) :: {:ok, Ory.Model.JsonError.t} | {:ok, Ory.Model.JsonWebKeySet.t} | {:error, Tesla.Env.t}
def well_known(connection, _opts \\ []) do
%{}
|> method(:get)
|> url("/.well-known/jwks.json")
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{ 200, %Ory.Model.JsonWebKeySet{}},
{ 500, %Ory.Model.JsonError{}}
])
end
end