Ory SDK

repository·master·Indexed 41 days ago

https://github.com/ory/sdk

Generated client libraries for the Ory Ecosystem (Kratos, Hydra, Keto, etc.) to facilitate interaction with Ory services. Includes SDKs for Dart (ory_client 1.22.22), .NET, Elixir (ory_client ~> 1.22.66), and Go (client-go), providing access to API groups such as FrontendApi, IdentityApi, OAuth2Api, OidcApi, and PermissionApi.

Tokens
787.2K
Snippets
1.6K
Records
2K
Agent score
51%

What's inside Ory SDK

  1. Overview of FrontendApi

    master

    The FrontendApi provides endpoints for managing user flows in a browser-based or native application context. It includes methods for initializing and updating login, registration, recovery, settings, and verification flows.

    Key Flow Types:

    • Browser Flows: Designed for clients with a browser (e.g., Chrome, Firefox). These endpoints handle cookies and anti-CSRF measures automatically. Examples include create_browser_login_flow and create_browser_registration_flow.
    • Native Flows: Designed for clients without a browser (e.g., mobile apps). These use API-based endpoints like create_native_login_flow and do not rely on browser cookies.

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

  2. Overview of Ory Python SDK Models

    master

    The Ory Python SDK includes a wide range of models representing the various entities and request/response structures used across the Ory ecosystem. These models cover areas such as:

    • Identity & Authentication: Identity, LoginFlow, RegistrationFlow, Session, Credentials.
    • OAuth2 & OIDC: OAuth2Client, OAuth2ConsentRequest, IntrospectedOAuth2Token.
    • Project & Workspace Management: Project, Workspace, Organization, Subscription.
    • API Key Management: IssuedApiKey, ImportedApiKey, WorkspaceApiKey.
    • UI & Flow States: UiContainer, LoginFlowState, RegistrationFlowState.

    Detailed documentation for each specific model is available in the docs/ directory of the client package.

  3. Overview of Ory Python Client API Endpoints

    master

    The Ory Python SDK provides access to various API groups for managing identity, authentication, authorization, and project configurations. The client is organized into several specialized API classes, including:

    • ApiKeysApi: Manage and verify API keys (import, issue, rotate, revoke).
    • CourierApi: Manage courier messages.
    • ElementsApi: Retrieve Ory Elements configurations.
    • EventsApi: Manage event streams for projects.
    • FrontendApi: Handle self-service flows (login, registration, recovery, settings, verification) for both browsers and native apps.
    • IdentityApi: Manage identities, identity schemas, and sessions.
    • JwkApi: Manage JSON Web Key Sets (JWKS).
    • MetadataApi: Retrieve software version information.
    • OAuth2Api: Manage OAuth 2.0 clients, tokens, consent requests, and authorization endpoints.
    • OidcApi: Handle OpenID Connect discovery, dynamic client registration, and verifiable credentials.
    • PermissionApi: Check and expand permissions using relation tuples.
    • ProjectApi: Manage Ory Network projects, organizations, and project-level API keys.
    • RelationshipApi: Create, query, and manage relationships and namespaces.
    • WorkspaceApi: Manage workspaces and workspace-level API keys.
  4. Overview of Rust API Client Endpoints

    master
    The Rust API client for ory-client provides access to various Ory services through structured API classes. All URIs are relative to https://playground.projects.oryapis.com. The client is organized into functional modules such as ApiKeysApi, FrontendApi, IdentityApi, OAuth2Api, and ProjectApi.
  5. Use IdentityAPI in Go

    master

    The IdentityAPI provides administrative endpoints for managing identities, recovery codes, recovery links, and test login flows. All URIs are relative to https://playground.projects.oryapis.com (or your specific Ory instance).

    Available methods include:

    • BatchPatchIdentities: Create multiple identities via PATCH /admin/identities.
    • CreateIdentity: Create a single identity via POST /admin/identities.
    • CreateRecoveryCodeForIdentity: Create a recovery code via POST /admin/recovery/code.
    • CreateRecoveryLinkForIdentity: Create a recovery link via POST /admin/recovery/link.
    • CreateTestLoginFlow: Create a test OIDC login flow via POST /admin/test-login-flows.
    • DeleteIdentity: Delete an identity via DELETE /admin/identities/{id}.
    • GetIdentity: Retrieve an identity via GET /admin/identities/{id}.
    • ListIdentities: List identities via GET /admin/identities.
    • UpdateIdentity: Update an identity via PUT /admin/identities/{id}.

    Authorization: Requires an oryAccessToken. Headers: Requires Content-Type: application/json and Accept: application/json.

    import (
    	openapiclient "github.com/ory/client-go"
    )
    
    // Example initialization
    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    // Use apiClient.IdentityAPI to access methods
  6. Use the Ory .NET Client

    master
    The clients/client/dotnet directory contains the .NET SDK for the Ory Ecosystem, generated using OpenAPI Generator. For detailed installation instructions, API references, and usage examples specific to the .NET implementation, refer to the main client README located at src/Ory.Client/README.md within this package.
  7. OryClient::FrontendApi Overview

    master

    The OryClient::FrontendApi provides methods for managing browser-based and native application user flows (login, registration, recovery, settings, etc.) within the Ory ecosystem.

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

    Common flow types include:

    • Browser Flows: Designed for clients with a browser (e.g., Chrome, Firefox) that require cookie handling and CSRF protection.
    • Native Flows: Designed for mobile or desktop applications that do not rely on browser cookies.
    • FedCM Flows: For Federated Credential Management.
  8. Use the Kratos MetadataAPI to check service status

    master

    The MetadataAPI in the Kratos Go SDK provides endpoints to check the health and version of the running Kratos instance. These endpoints are useful for monitoring, health checks, and verifying software versions.

    All URIs are relative to http://localhost by default, though this is controlled by your Configuration.

    Available methods:

    • GetVersion: Returns the running software version.
    • IsAlive: Checks the HTTP server status.
    • IsReady: Checks both the HTTP server and the database status.
  9. Ory.Client.Api.IdentityApi Overview

    master

    The IdentityApi provides administrative endpoints for managing identities and sessions in the Ory ecosystem. All URIs are relative to https://playground.projects.oryapis.com.

    Key capabilities include:

    • Creating and patching identities (single or batch).
    • Managing credentials and recovery codes/links.
    • Managing sessions (listing, deleting, extending, or bulk management).
    • Retrieving identity schemas and specific identity details.
  10. Use Ory\Client\FrontendApi to manage user profiles

    master

    The Ory\Client\FrontendApi class provides endpoints used by frontend applications (such as Single-Page-Apps, Native Apps, or Server Apps) to manage a user's own profile and self-service flows.

    Common operations include:

    • Browser Flows: createBrowserLoginFlow, createBrowserLogoutFlow, createBrowserRecoveryFlow, createBrowserRegistrationFlow, createBrowserSettingsFlow, and createBrowserVerificationFlow.
    • Native/API Flows: createNativeLoginFlow, createNativeRecoveryFlow, createNativeRegistrationFlow, createNativeSettingsFlow, and createNativeVerificationFlow.
    • Session Management: listMySessions, disableMySession, disableMyOtherSessions, and exchangeSessionToken.
    • Identity/Auth: toSession (check current session), updateLoginFlow, updateRegistrationFlow, etc.

    All URIs are relative to https://playground.projects.oryapis.com unless otherwise specified.

  11. Use the @ory/client-fetch TypeScript helpers

    master
    The @ory/client-fetch package provides specialized TypeScript client helpers designed for use in projects like Ory Elements. These helpers are only included in the -fetch version of the client (e.g., @ory/client-fetch, @ory/keto-client-fetch, etc.) and are not present in the standard @ory/client packages. Use these when you require additional utility functions specifically optimized for the Fetch API in TypeScript environments.
  12. Explore Kratos Go client models and error types

    master

    The Kratos Go client includes comprehensive documentation for all API models and error types. Key categories include:

    • Flows & States: LoginFlow, RegistrationFlow, RecoveryFlow, SettingsFlow, VerificationFlow and their corresponding State models.
    • Identities: Identity, IdentityPatch, CreateIdentityBody, and various credential types like IdentityCredentialsPassword or IdentityCredentialsOidc.
    • Sessions: Session and SessionDevice.
    • Errors: GenericError, FlowError, ErrorBrowserLocationChangeRequired, and others specific to flow lifecycle management.
    • UI Components: UiContainer, UiNode, and various UiNodeAttributes for building self-service UI flows.