Skip to content

Latest commit

 

History

History
570 lines (526 loc) · 46 KB

README.md

File metadata and controls

570 lines (526 loc) · 46 KB

Ory.Client - the C# library for the Ory APIs

Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers.

This C# SDK is automatically generated by the OpenAPI Generator project:

  • API version: v1.15.6
  • SDK version: 1.15.6
  • Generator version: 7.7.0
  • Build package: org.openapitools.codegen.languages.CSharpClientCodegen For more information, please visit https://www.ory.sh

Frameworks supported

Dependencies

The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742. NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See RestSharp#1406.

Installation

Run the following command to generate the DLL

  • [Mac/Linux] /bin/sh build.sh
  • [Windows] build.bat

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

using Ory.Client.Api;
using Ory.Client.Client;
using Ory.Client.Model;

Packaging

A .nuspec is included with the project. You can follow the Nuget quickstart to create and publish packages.

This .nuspec uses placeholders from the .csproj, so build the .csproj directly:

nuget pack -Build -OutputDirectory out Ory.Client.csproj

Then, publish to a local feed or other host and consume the new package via Nuget as usual.

Usage

To use the API client with a HTTP proxy, setup a System.Net.WebProxy

Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;

Getting Started

using System.Collections.Generic;
using System.Diagnostics;
using Ory.Client.Api;
using Ory.Client.Client;
using Ory.Client.Model;

namespace Example
{
    public class Example
    {
        public static void Main()
        {

            Configuration config = new Configuration();
            config.BasePath = "https://.projects.oryapis.com";
            // Configure Bearer token for authorization: oryAccessToken
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new CourierApi(config);
            var id = "id_example";  // string | MessageID is the ID of the message.

            try
            {
                // Get a Message
                ClientMessage result = apiInstance.GetCourierMessage(id);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling CourierApi.GetCourierMessage: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }

        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://.projects.oryapis.com

Class Method HTTP request Description
CourierApi GetCourierMessage GET /admin/courier/messages/{id} Get a Message
CourierApi ListCourierMessages GET /admin/courier/messages List Messages
EventsApi CreateEventStream POST /projects/{project_id}/eventstreams Create an event stream for your project.
EventsApi DeleteEventStream DELETE /projects/{project_id}/eventstreams/{event_stream_id} Remove an event stream from a project
EventsApi ListEventStreams GET /projects/{project_id}/eventstreams List all event streams for the project. This endpoint is not paginated.
EventsApi SetEventStream PUT /projects/{project_id}/eventstreams/{event_stream_id} Update an event stream for a project.
FrontendApi CreateBrowserLoginFlow GET /self-service/login/browser Create Login Flow for Browsers
FrontendApi CreateBrowserLogoutFlow GET /self-service/logout/browser Create a Logout URL for Browsers
FrontendApi CreateBrowserRecoveryFlow GET /self-service/recovery/browser Create Recovery Flow for Browsers
FrontendApi CreateBrowserRegistrationFlow GET /self-service/registration/browser Create Registration Flow for Browsers
FrontendApi CreateBrowserSettingsFlow GET /self-service/settings/browser Create Settings Flow for Browsers
FrontendApi CreateBrowserVerificationFlow GET /self-service/verification/browser Create Verification Flow for Browser Clients
FrontendApi CreateNativeLoginFlow GET /self-service/login/api Create Login Flow for Native Apps
FrontendApi CreateNativeRecoveryFlow GET /self-service/recovery/api Create Recovery Flow for Native Apps
FrontendApi CreateNativeRegistrationFlow GET /self-service/registration/api Create Registration Flow for Native Apps
FrontendApi CreateNativeSettingsFlow GET /self-service/settings/api Create Settings Flow for Native Apps
FrontendApi CreateNativeVerificationFlow GET /self-service/verification/api Create Verification Flow for Native Apps
FrontendApi DisableMyOtherSessions DELETE /sessions Disable my other sessions
FrontendApi DisableMySession DELETE /sessions/{id} Disable one of my sessions
FrontendApi ExchangeSessionToken GET /sessions/token-exchange Exchange Session Token
FrontendApi GetFlowError GET /self-service/errors Get User-Flow Errors
FrontendApi GetLoginFlow GET /self-service/login/flows Get Login Flow
FrontendApi GetRecoveryFlow GET /self-service/recovery/flows Get Recovery Flow
FrontendApi GetRegistrationFlow GET /self-service/registration/flows Get Registration Flow
FrontendApi GetSettingsFlow GET /self-service/settings/flows Get Settings Flow
FrontendApi GetVerificationFlow GET /self-service/verification/flows Get Verification Flow
FrontendApi GetWebAuthnJavaScript GET /.well-known/ory/webauthn.js Get WebAuthn JavaScript
FrontendApi ListMySessions GET /sessions Get My Active Sessions
FrontendApi PerformNativeLogout DELETE /self-service/logout/api Perform Logout for Native Apps
FrontendApi ToSession GET /sessions/whoami Check Who the Current HTTP Session Belongs To
FrontendApi UpdateLoginFlow POST /self-service/login Submit a Login Flow
FrontendApi UpdateLogoutFlow GET /self-service/logout Update Logout Flow
FrontendApi UpdateRecoveryFlow POST /self-service/recovery Update Recovery Flow
FrontendApi UpdateRegistrationFlow POST /self-service/registration Update Registration Flow
FrontendApi UpdateSettingsFlow POST /self-service/settings Complete Settings Flow
FrontendApi UpdateVerificationFlow POST /self-service/verification Complete Verification Flow
IdentityApi BatchPatchIdentities PATCH /admin/identities Create multiple identities
IdentityApi CreateIdentity POST /admin/identities Create an Identity
IdentityApi CreateRecoveryCodeForIdentity POST /admin/recovery/code Create a Recovery Code
IdentityApi CreateRecoveryLinkForIdentity POST /admin/recovery/link Create a Recovery Link
IdentityApi DeleteIdentity DELETE /admin/identities/{id} Delete an Identity
IdentityApi DeleteIdentityCredentials DELETE /admin/identities/{id}/credentials/{type} Delete a credential for a specific identity
IdentityApi DeleteIdentitySessions DELETE /admin/identities/{id}/sessions Delete & Invalidate an Identity's Sessions
IdentityApi DisableSession DELETE /admin/sessions/{id} Deactivate a Session
IdentityApi ExtendSession PATCH /admin/sessions/{id}/extend Extend a Session
IdentityApi GetIdentity GET /admin/identities/{id} Get an Identity
IdentityApi GetIdentitySchema GET /schemas/{id} Get Identity JSON Schema
IdentityApi GetSession GET /admin/sessions/{id} Get Session
IdentityApi ListIdentities GET /admin/identities List Identities
IdentityApi ListIdentitySchemas GET /schemas Get all Identity Schemas
IdentityApi ListIdentitySessions GET /admin/identities/{id}/sessions List an Identity's Sessions
IdentityApi ListSessions GET /admin/sessions List All Sessions
IdentityApi PatchIdentity PATCH /admin/identities/{id} Patch an Identity
IdentityApi UpdateIdentity PUT /admin/identities/{id} Update an Identity
JwkApi CreateJsonWebKeySet POST /admin/keys/{set} Create JSON Web Key
JwkApi DeleteJsonWebKey DELETE /admin/keys/{set}/{kid} Delete JSON Web Key
JwkApi DeleteJsonWebKeySet DELETE /admin/keys/{set} Delete JSON Web Key Set
JwkApi GetJsonWebKey GET /admin/keys/{set}/{kid} Get JSON Web Key
JwkApi GetJsonWebKeySet GET /admin/keys/{set} Retrieve a JSON Web Key Set
JwkApi SetJsonWebKey PUT /admin/keys/{set}/{kid} Set JSON Web Key
JwkApi SetJsonWebKeySet PUT /admin/keys/{set} Update a JSON Web Key Set
MetadataApi GetVersion GET /version Return Running Software Version.
OAuth2Api AcceptOAuth2ConsentRequest PUT /admin/oauth2/auth/requests/consent/accept Accept OAuth 2.0 Consent Request
OAuth2Api AcceptOAuth2LoginRequest PUT /admin/oauth2/auth/requests/login/accept Accept OAuth 2.0 Login Request
OAuth2Api AcceptOAuth2LogoutRequest PUT /admin/oauth2/auth/requests/logout/accept Accept OAuth 2.0 Session Logout Request
OAuth2Api CreateOAuth2Client POST /admin/clients Create OAuth 2.0 Client
OAuth2Api DeleteOAuth2Client DELETE /admin/clients/{id} Delete OAuth 2.0 Client
OAuth2Api DeleteOAuth2Token DELETE /admin/oauth2/tokens Delete OAuth 2.0 Access Tokens from specific OAuth 2.0 Client
OAuth2Api DeleteTrustedOAuth2JwtGrantIssuer DELETE /admin/trust/grants/jwt-bearer/issuers/{id} Delete Trusted OAuth2 JWT Bearer Grant Type Issuer
OAuth2Api GetOAuth2Client GET /admin/clients/{id} Get an OAuth 2.0 Client
OAuth2Api GetOAuth2ConsentRequest GET /admin/oauth2/auth/requests/consent Get OAuth 2.0 Consent Request
OAuth2Api GetOAuth2LoginRequest GET /admin/oauth2/auth/requests/login Get OAuth 2.0 Login Request
OAuth2Api GetOAuth2LogoutRequest GET /admin/oauth2/auth/requests/logout Get OAuth 2.0 Session Logout Request
OAuth2Api GetTrustedOAuth2JwtGrantIssuer GET /admin/trust/grants/jwt-bearer/issuers/{id} Get Trusted OAuth2 JWT Bearer Grant Type Issuer
OAuth2Api IntrospectOAuth2Token POST /admin/oauth2/introspect Introspect OAuth2 Access and Refresh Tokens
OAuth2Api ListOAuth2Clients GET /admin/clients List OAuth 2.0 Clients
OAuth2Api ListOAuth2ConsentSessions GET /admin/oauth2/auth/sessions/consent List OAuth 2.0 Consent Sessions of a Subject
OAuth2Api ListTrustedOAuth2JwtGrantIssuers GET /admin/trust/grants/jwt-bearer/issuers List Trusted OAuth2 JWT Bearer Grant Type Issuers
OAuth2Api OAuth2Authorize GET /oauth2/auth OAuth 2.0 Authorize Endpoint
OAuth2Api Oauth2TokenExchange POST /oauth2/token The OAuth 2.0 Token Endpoint
OAuth2Api PatchOAuth2Client PATCH /admin/clients/{id} Patch OAuth 2.0 Client
OAuth2Api RejectOAuth2ConsentRequest PUT /admin/oauth2/auth/requests/consent/reject Reject OAuth 2.0 Consent Request
OAuth2Api RejectOAuth2LoginRequest PUT /admin/oauth2/auth/requests/login/reject Reject OAuth 2.0 Login Request
OAuth2Api RejectOAuth2LogoutRequest PUT /admin/oauth2/auth/requests/logout/reject Reject OAuth 2.0 Session Logout Request
OAuth2Api RevokeOAuth2ConsentSessions DELETE /admin/oauth2/auth/sessions/consent Revoke OAuth 2.0 Consent Sessions of a Subject
OAuth2Api RevokeOAuth2LoginSessions DELETE /admin/oauth2/auth/sessions/login Revokes OAuth 2.0 Login Sessions by either a Subject or a SessionID
OAuth2Api RevokeOAuth2Token POST /oauth2/revoke Revoke OAuth 2.0 Access or Refresh Token
OAuth2Api SetOAuth2Client PUT /admin/clients/{id} Set OAuth 2.0 Client
OAuth2Api SetOAuth2ClientLifespans PUT /admin/clients/{id}/lifespans Set OAuth2 Client Token Lifespans
OAuth2Api TrustOAuth2JwtGrantIssuer POST /admin/trust/grants/jwt-bearer/issuers Trust OAuth2 JWT Bearer Grant Type Issuer
OidcApi CreateOidcDynamicClient POST /oauth2/register Register OAuth2 Client using OpenID Dynamic Client Registration
OidcApi CreateVerifiableCredential POST /credentials Issues a Verifiable Credential
OidcApi DeleteOidcDynamicClient DELETE /oauth2/register/{id} Delete OAuth 2.0 Client using the OpenID Dynamic Client Registration Management Protocol
OidcApi DiscoverOidcConfiguration GET /.well-known/openid-configuration OpenID Connect Discovery
OidcApi GetOidcDynamicClient GET /oauth2/register/{id} Get OAuth2 Client using OpenID Dynamic Client Registration
OidcApi GetOidcUserInfo GET /userinfo OpenID Connect Userinfo
OidcApi RevokeOidcSession GET /oauth2/sessions/logout OpenID Connect Front- and Back-channel Enabled Logout
OidcApi SetOidcDynamicClient PUT /oauth2/register/{id} Set OAuth2 Client using OpenID Dynamic Client Registration
PermissionApi BatchCheckPermission POST /relation-tuples/batch/check Batch check permissions
PermissionApi CheckPermission GET /relation-tuples/check/openapi Check a permission
PermissionApi CheckPermissionOrError GET /relation-tuples/check Check a permission
PermissionApi ExpandPermissions GET /relation-tuples/expand Expand a Relationship into permissions.
PermissionApi PostCheckPermission POST /relation-tuples/check/openapi Check a permission
PermissionApi PostCheckPermissionOrError POST /relation-tuples/check Check a permission
ProjectApi CreateOrganization POST /projects/{project_id}/organizations Create an Enterprise SSO Organization
ProjectApi CreateProject POST /projects Create a Project
ProjectApi CreateProjectApiKey POST /projects/{project}/tokens Create project API token
ProjectApi DeleteOrganization DELETE /projects/{project_id}/organizations/{organization_id} Delete Enterprise SSO Organization
ProjectApi DeleteProjectApiKey DELETE /projects/{project}/tokens/{token_id} Delete project API token
ProjectApi GetOrganization GET /projects/{project_id}/organizations/{organization_id} Get Enterprise SSO Organization by ID
ProjectApi GetProject GET /projects/{project_id} Get a Project
ProjectApi GetProjectMembers GET /projects/{project}/members Get all members associated with this project
ProjectApi ListOrganizations GET /projects/{project_id}/organizations List all Enterprise SSO organizations
ProjectApi ListProjectApiKeys GET /projects/{project}/tokens List a project's API Tokens
ProjectApi ListProjects GET /projects List All Projects
ProjectApi PatchProject PATCH /projects/{project_id} Patch an Ory Network Project Configuration
ProjectApi PatchProjectWithRevision PATCH /projects/{project_id}/revision/{revision_id} Patch an Ory Network Project Configuration based on a revision ID
ProjectApi PurgeProject DELETE /projects/{project_id} Irrecoverably purge a project
ProjectApi RemoveProjectMember DELETE /projects/{project}/members/{member} Remove a member associated with this project
ProjectApi SetProject PUT /projects/{project_id} Update an Ory Network Project Configuration
ProjectApi UpdateOrganization PUT /projects/{project_id}/organizations/{organization_id} Update an Enterprise SSO Organization
RelationshipApi CheckOplSyntax POST /opl/syntax/check Check the syntax of an OPL file
RelationshipApi CreateRelationship PUT /admin/relation-tuples Create a Relationship
RelationshipApi DeleteRelationships DELETE /admin/relation-tuples Delete Relationships
RelationshipApi GetRelationships GET /relation-tuples Query relationships
RelationshipApi ListRelationshipNamespaces GET /namespaces Query namespaces
RelationshipApi PatchRelationships PATCH /admin/relation-tuples Patch Multiple Relationships
WellknownApi DiscoverJsonWebKeys GET /.well-known/jwks.json Discover Well-Known JSON Web Keys
WorkspaceApi CreateWorkspace POST /workspaces Create a new workspace
WorkspaceApi CreateWorkspaceApiKey POST /workspaces/{workspace}/tokens Create workspace API key
WorkspaceApi DeleteWorkspaceApiKey DELETE /workspaces/{workspace}/tokens/{token_id} Delete workspace API token
WorkspaceApi GetWorkspace GET /workspaces/{workspace} Get a workspace
WorkspaceApi ListWorkspaceApiKeys GET /workspaces/{workspace}/tokens List a workspace's API Tokens
WorkspaceApi ListWorkspaceProjects GET /workspaces/{workspace}/projects List all projects of a workspace
WorkspaceApi ListWorkspaces GET /workspaces List workspaces the user is a member of
WorkspaceApi UpdateWorkspace PUT /workspaces/{workspace} Update an workspace

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

basic

  • Type: HTTP basic authentication

bearer

  • Type: Bearer Authentication

oauth2

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: https://hydra.demo.ory.sh/oauth2/auth
  • Scopes:
    • offline: A scope required when requesting refresh tokens (alias for `offline_access`)
    • offline_access: A scope required when requesting refresh tokens
    • openid: Request an OpenID Connect ID Token

oryAccessToken

  • Type: Bearer Authentication

oryWorkspaceApiKey

  • Type: Bearer Authentication