Documentation for all public and administrative Ory Kratos APIs. Public and administrative APIs are exposed on different ports. Public APIs can face the public internet without any protection while administrative APIs should never be exposed without prior authorization. To protect the administative API port you should use something like Nginx, Ory Oathkeeper, or any other technology capable of authorizing incoming requests.
This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.
- API version: v0.6.0-alpha.16
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen
Install the following dependencies:
go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
Put the package under your project folder and add the following in import:
import client "github.com/ory/kratos-client-go"
To use a proxy, set the environment variable HTTP_PROXY
:
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
Default configuration comes with Servers
field that contains server objects as defined in the OpenAPI specification.
For using other server than the one defined on index 0 set context value sw.ContextServerIndex
of type int
.
ctx := context.WithValue(context.Background(), client.ContextServerIndex, 1)
Templated server URL is formatted using default variables from configuration or from context value sw.ContextServerVariables
of type map[string]string
.
ctx := context.WithValue(context.Background(), client.ContextServerVariables, map[string]string{
"basePath": "v2",
})
Note, enum values are always validated and all unused variables are silently ignored.
Each operation can use different server URL defined using OperationServers
map in the Configuration
.
An operation is uniquely identifield by "{classname}Service.{nickname}"
string.
Similar rules for overriding default operation server index and variables applies by using sw.ContextOperationServerIndices
and sw.ContextOperationServerVariables
context maps.
ctx := context.WithValue(context.Background(), client.ContextOperationServerIndices, map[string]int{
"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), client.ContextOperationServerVariables, map[string]map[string]string{
"{classname}Service.{nickname}": {
"port": "8443",
},
})
All URIs are relative to https://demo.tenants.oryapis.com/api/kratos/public
Class | Method | HTTP request | Description |
---|---|---|---|
AdminApi | CreateIdentity | Post /identities | Create an Identity |
AdminApi | CreateRecoveryLink | Post /recovery/link | Create a Recovery Link |
AdminApi | DeleteIdentity | Delete /identities/{id} | Delete an Identity |
AdminApi | GetIdentity | Get /identities/{id} | Get an Identity |
AdminApi | GetSchema | Get /schemas/{id} | |
AdminApi | GetSelfServiceError | Get /self-service/errors | Get User-Facing Self-Service Errors |
AdminApi | GetSelfServiceLoginFlow | Get /self-service/login/flows | Get Login Flow |
AdminApi | GetSelfServiceRecoveryFlow | Get /self-service/recovery/flows | Get information about a recovery flow |
AdminApi | GetSelfServiceRegistrationFlow | Get /self-service/registration/flows | Get Registration Flow |
AdminApi | GetSelfServiceSettingsFlow | Get /self-service/settings/flows | Get Settings Flow |
AdminApi | GetSelfServiceVerificationFlow | Get /self-service/verification/flows | Get Verification Flow |
AdminApi | GetVersion | Get /version | Return Running Software Version. |
AdminApi | IsAlive | Get /health/alive | Check HTTP Server Status |
AdminApi | IsReady | Get /health/ready | Check HTTP Server and Database Status |
AdminApi | ListIdentities | Get /identities | List Identities |
AdminApi | Prometheus | Get /metrics/prometheus | Get snapshot metrics from the Hydra service. If you're using k8s, you can then add annotations to your deployment like so: |
AdminApi | UpdateIdentity | Put /identities/{id} | Update an Identity |
PublicApi | GetSchema | Get /schemas/{id} | |
PublicApi | GetSelfServiceError | Get /self-service/errors | Get User-Facing Self-Service Errors |
PublicApi | GetSelfServiceLoginFlow | Get /self-service/login/flows | Get Login Flow |
PublicApi | GetSelfServiceRecoveryFlow | Get /self-service/recovery/flows | Get information about a recovery flow |
PublicApi | GetSelfServiceRegistrationFlow | Get /self-service/registration/flows | Get Registration Flow |
PublicApi | GetSelfServiceSettingsFlow | Get /self-service/settings/flows | Get Settings Flow |
PublicApi | GetSelfServiceVerificationFlow | Get /self-service/verification/flows | Get Verification Flow |
PublicApi | InitializeSelfServiceBrowserLogoutFlow | Get /self-service/browser/flows/logout | Initialize Browser-Based Logout User Flow |
PublicApi | InitializeSelfServiceLoginViaAPIFlow | Get /self-service/login/api | Initialize Login Flow for API clients |
PublicApi | InitializeSelfServiceLoginViaBrowserFlow | Get /self-service/login/browser | Initialize Login Flow for browsers |
PublicApi | InitializeSelfServiceRecoveryViaAPIFlow | Get /self-service/recovery/api | Initialize Recovery Flow for API Clients |
PublicApi | InitializeSelfServiceRecoveryViaBrowserFlow | Get /self-service/recovery/browser | Initialize Recovery Flow for Browser Clients |
PublicApi | InitializeSelfServiceRegistrationViaAPIFlow | Get /self-service/registration/api | Initialize Registration Flow for API clients |
PublicApi | InitializeSelfServiceRegistrationViaBrowserFlow | Get /self-service/registration/browser | Initialize Registration Flow for browsers |
PublicApi | InitializeSelfServiceSettingsViaAPIFlow | Get /self-service/settings/api | Initialize Settings Flow for API Clients |
PublicApi | InitializeSelfServiceSettingsViaBrowserFlow | Get /self-service/settings/browser | Initialize Settings Flow for Browsers |
PublicApi | InitializeSelfServiceVerificationViaAPIFlow | Get /self-service/verification/api | Initialize Verification Flow for API Clients |
PublicApi | InitializeSelfServiceVerificationViaBrowserFlow | Get /self-service/verification/browser | Initialize Verification Flow for Browser Clients |
PublicApi | RevokeSession | Delete /sessions | Initialize Logout Flow for API Clients - Revoke a Session |
PublicApi | SubmitSelfServiceLoginFlow | Post /self-service/login | Submit a Login Flow |
PublicApi | SubmitSelfServiceRecoveryFlow | Post /self-service/recovery | Complete Recovery Flow |
PublicApi | SubmitSelfServiceRecoveryFlowWithLinkMethod | Post /self-service/recovery/methods/link | Complete Recovery Flow with Link Method |
PublicApi | SubmitSelfServiceRegistrationFlow | Post /self-service/registration | Submit a Registration Flow |
PublicApi | SubmitSelfServiceSettingsFlow | Post /self-service/settings | Complete Settings Flow |
PublicApi | SubmitSelfServiceVerificationFlow | Post /self-service/verification/methods/link | Complete Verification Flow |
PublicApi | Whoami | Get /sessions/whoami | Check Who the Current HTTP Session Belongs To |
- AuthenticateOKBody
- ContainerChangeResponseItem
- ContainerCreateCreatedBody
- ContainerTopOKBody
- ContainerUpdateOKBody
- ContainerWaitOKBody
- ContainerWaitOKBodyError
- CreateIdentity
- CreateRecoveryLink
- ErrorContainer
- ErrorResponse
- GenericError
- GenericErrorPayload
- GraphDriverData
- HealthNotReadyStatus
- HealthStatus
- IdResponse
- Identity
- IdentityCredentials
- ImageDeleteResponseItem
- ImageSummary
- InlineResponse200
- InlineResponse2001
- InlineResponse503
- LoginFlow
- LoginViaApiResponse
- Meta
- Plugin
- PluginConfig
- PluginConfigArgs
- PluginConfigInterface
- PluginConfigLinux
- PluginConfigNetwork
- PluginConfigRootfs
- PluginConfigUser
- PluginDevice
- PluginEnv
- PluginInterfaceType
- PluginMount
- PluginSettings
- Port
- RecoveryAddress
- RecoveryFlow
- RecoveryLink
- RegistrationFlow
- RegistrationViaApiResponse
- RevokeSession
- ServiceUpdateResponse
- Session
- SettingsFlow
- SettingsProfileFormConfig
- SettingsViaApiResponse
- SubmitSelfServiceBrowserSettingsOIDCFlowPayload
- SubmitSelfServiceLoginFlow
- SubmitSelfServiceLoginFlowWithPasswordMethod
- SubmitSelfServiceRecoveryFlowWithLinkMethod
- SubmitSelfServiceRegistrationFlow
- SubmitSelfServiceRegistrationFlowWithPasswordMethod
- SubmitSelfServiceSettingsFlow
- SubmitSelfServiceSettingsFlowWithPasswordMethod
- SubmitSelfServiceSettingsFlowWithProfileMethod
- SubmitSelfServiceVerificationFlowWithLinkMethod
- UiContainer
- UiNode
- UiNodeAnchorAttributes
- UiNodeAttributes
- UiNodeImageAttributes
- UiNodeInputAttributes
- UiNodeInputAttributesValue
- UiNodeTextAttributes
- UiText
- UpdateIdentity
- VerifiableAddress
- VerificationFlow
- Version
- Volume
- VolumeUsageData
- Type: API key
- API key parameter name: ory_kratos_session
- Location:
Note, each API key must be added to a map of map[string]APIKey
where the key is: ory_kratos_session and passed in as the auth context for each request.
- Type: API key
- API key parameter name: X-Session-Token
- Location: HTTP header
Note, each API key must be added to a map of map[string]APIKey
where the key is: X-Session-Token and passed in as the auth context for each request.
Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:
PtrBool
PtrInt
PtrInt32
PtrInt64
PtrFloat
PtrFloat32
PtrFloat64
PtrString
PtrTime