Go to file
aeneasr f47675b820
autogen: pin v1.1.0 release commit
2024-02-20 10:34:09 +01:00
.bin fix: decouple quickstart scenarios (#336) 2020-04-12 13:17:22 +02:00
.docker chore: update docker base images (#3521) 2023-09-19 17:01:23 +02:00
.github test: fix hydra tests on master (#3737) 2024-02-05 14:17:32 +00:00
.schema docs: improve enum handling and completeness (#3714) 2024-01-30 16:18:17 +01:00
.schemastore autogen: pin v1.1.0 release commit 2024-02-20 10:34:09 +01:00
.vscode fix: change ListIdentities to keyset pagination 2023-10-11 14:16:00 +02:00
cipher fix: update year 2023-01-03 08:22:16 +01:00
cmd fix: add consistency flag (#3733) 2024-02-05 17:55:53 +01:00
continuity chore: add missing tracing in manager_cookie.go (#3615) 2023-11-10 14:04:08 +00:00
contrib/quickstart feat: support MFA via SMS (#3682) 2024-01-26 17:01:11 +01:00
corpx chore: fix github.com/bxcodec/faker/v3 is deprecated (#3607) 2023-11-10 10:14:35 +01:00
courier feat: improved webhook tracing (#3746) 2024-02-12 13:26:54 +01:00
coverage feat: passwordless browser login and registration via code to email (#3378) 2023-08-29 15:43:03 +02:00
docs refactor: move docs to ory/docs 2022-02-14 19:47:51 +01:00
driver feat: improved webhook tracing (#3746) 2024-02-12 13:26:54 +01:00
embedx fix: http courier using should use lower case json (#3740) 2024-02-09 11:46:52 +01:00
examples/go feat: support exporting of all credential types (#3290) 2023-05-24 18:20:14 +02:00
hash fix: lint 2024-01-24 13:49:49 +01:00
hydra chore: update Ory Hydra SDK (#3729) 2024-02-05 16:39:02 +01:00
identity feat: list by OIDC cred (#3721) 2024-02-02 09:59:28 +01:00
internal fix: don't require code credential for MFA flows (#3753) 2024-02-16 10:10:11 +01:00
otp fix: update year 2023-01-03 08:22:16 +01:00
persistence feat: improved webhook tracing (#3746) 2024-02-12 13:26:54 +01:00
request feat: improved webhook tracing (#3746) 2024-02-12 13:26:54 +01:00
schema feat: support MFA via SMS (#3682) 2024-01-26 17:01:11 +01:00
script fix: change shebangs and makefile from /bin/bash to /usr/bin/env bash (#3597) 2023-10-27 11:45:00 +02:00
selfservice fix: don't require code credential for MFA flows (#3753) 2024-02-16 10:10:11 +01:00
session chore: update Ory Hydra SDK (#3729) 2024-02-05 16:39:02 +01:00
spec autogen(openapi): regenerate swagger spec and internal client 2024-02-05 15:54:22 +00:00
test feat: support MFA via SMS (#3682) 2024-01-26 17:01:11 +01:00
text feat: support MFA via SMS (#3682) 2024-01-26 17:01:11 +01:00
ui chore: fix github.com/bxcodec/faker/v3 is deprecated (#3607) 2023-11-10 10:14:35 +01:00
x feat: improved webhook tracing (#3746) 2024-02-12 13:26:54 +01:00
.dockerignore fix: resolve pkger issues 2020-09-03 15:21:29 +02:00
.editorconfig feat: add cypress e2e tests (#334) 2020-05-01 17:44:01 +02:00
.gitignore feat: support for B2B SSO (#3489) 2023-09-21 10:14:52 +02:00
.golangci.yml ci: remove deprecated linters (replaced by `unused`) 2022-10-04 14:17:07 +02:00
.goreleaser.yml feat: add distroless and static images (#3350) 2023-06-28 08:21:13 +00:00
.grype.yaml chore: ignore CVE-2023-4806 (#3532) 2023-09-26 09:46:44 +02:00
.mailmap chore: list contributors in file (#2878) 2022-11-10 21:42:35 +01:00
.nancy-ignore ci: remove nancy false positives from .nancy-ignore (#725) 2020-10-02 08:38:53 +02:00
.nvmrc feat: allow passing transient data from registration to webhook (#3104) 2023-02-21 17:05:23 +01:00
.orycli.yml chore: unset email and name after release hook (#3026) 2023-01-16 13:33:43 +01:00
.prettierignore chore: update ory-prettier-styles (#2749) 2022-09-22 19:02:35 -04:00
.reference-ignore chore: update repository templates (#731) 2020-10-02 18:19:00 +02:00
.trivyignore feat: implement `crypt(3)` hashers (#3303) 2023-06-09 18:21:03 +02:00
AUTHORS chore: list contributors in file (#2878) 2022-11-10 21:42:35 +01:00
CHANGELOG.md autogen(docs): regenerate and update changelog 2024-02-16 09:56:17 +00:00
CODE_OF_CONDUCT.md chore: update repository templates to af28aff50b 2023-08-03 15:37:02 +00:00
CONTRIBUTING.md chore: update repository templates to a2fba7e968 2022-11-02 00:58:06 +00:00
LICENSE docs: update repository templates 2020-05-26 15:16:36 +02:00
Makefile feat: support MFA via SMS (#3682) 2024-01-26 17:01:11 +01:00
README.md test: resolve cypress issues (#3531) 2023-09-25 15:14:15 +02:00
SECURITY.md chore: update repository templates to a2fba7e968 2022-11-02 00:58:06 +00:00
codecov.yml fix: codecov (#2879) 2022-11-09 09:27:25 +01:00
go.mod feat: improved webhook tracing (#3746) 2024-02-12 13:26:54 +01:00
go.sum feat: improved webhook tracing (#3746) 2024-02-12 13:26:54 +01:00
go_mod_indirect_pins.go chore: add launch config for VSCode (#3239) 2023-04-19 13:36:48 +02:00
install.sh fix: update download urls according to the new names (#2078) 2021-12-22 10:44:18 +01:00
main.go feat: pooled process-isolated Jsonnet VM 2024-01-24 13:49:49 +01:00
openapitools.json chore: bump openapi-generator (#3686) 2024-01-09 12:58:36 +00:00
package-lock.json chore: bump openapi-generator (#3686) 2024-01-09 12:58:36 +00:00
package.json chore: bump openapi-generator (#3686) 2024-01-09 12:58:36 +00:00
quickstart-crdb.yml feat: add token prefixes to session and logout tokens (#3132) 2023-03-17 12:34:04 +01:00
quickstart-debug.yml fix: add debug quickstart yml (#780) 2020-10-20 09:40:55 +02:00
quickstart-latest.yml fix: dockerfile clean up 2021-12-16 10:24:58 +01:00
quickstart-mysql.yml fix: move to new post-release steps (#2206) 2022-02-11 13:52:22 +01:00
quickstart-oathkeeper.yml fix: quickstart demos (#2940) 2023-01-04 11:26:02 +01:00
quickstart-postgres.yml feat: allow fuzzy-search on credential identifiers (#3526) 2023-10-02 12:14:28 +02:00
quickstart-selinux.yml feat: add selinux compatible quickstart config (#889) 2020-12-09 10:15:28 +01:00
quickstart-standalone.yml fix: docker-compose standalone definition 2022-01-14 22:45:43 +01:00
quickstart-tracing.yml feat: switch to opentelemetry tracing (#2318) 2022-04-29 12:43:59 +02:00
quickstart-webauthn.yml fix: use correct names in WebAuthN dialogs (#3215) 2023-04-06 11:46:34 +02:00
quickstart.yml autogen(docs): generate and bump docs 2023-07-12 20:25:37 +00:00

README.md

Ory Kratos - Cloud native Identity and User Management

Chat | Discussions | Newsletter

Guide | API Docs | Code Docs

Support this project!

Work in Open Source, Ory is hiring!


CI Tasks for Ory Kratos CII Best Practices

Ory Kratos is the developer-friendly, security-hardened and battle-tested Identity, User Management and Authentication system for the Cloud. Finally, it is no longer necessary to implement User Login for the umpteenth time!

Ory Kratos on the Ory Network

The Ory Network is the fastest, most secure and worry-free way to use Ory's Services. Ory Identities is powered by the Ory Kratos open source identity server, and it's fully API-compatible.

The Ory Network provides the infrastructure for modern end-to-end security:

  • Identity & credential management scaling to billions of users and devices
  • Registration, Login and Account management flows for passkey, biometric, social, SSO and multi-factor authentication
  • Pre-built login, registration and account management pages and components
  • OAuth2 and OpenID provider for single sign on, API access and machine-to-machine authorization
  • Low-latency permission checks based on Google's Zanzibar model and with built-in support for the Ory Permission Language

It's fully managed, highly available, developer & compliance-friendly!

  • GDPR-friendly secure storage with data locality
  • Cloud-native APIs, compatible with Ory's Open Source servers
  • Comprehensive admin tools with the web-based Ory Console and the Ory Command Line Interface (CLI)
  • Extensive documentation, straightforward examples and easy-to-follow guides
  • Fair, usage-based pricing

Sign up for a free developer account today!

Ory Network Hybrid Support Plan

Ory offers a support plan for Ory Network Hybrid, including Ory on private cloud deployments. If you have a self-hosted solution and would like help, consider a support plan! The team at Ory has years of experience in cloud computing. Ory's offering is the only official program for qualified support from the maintainers. For more information see the website or book a meeting!

Quickstart

Install the Ory CLI and create a new project to get started with Ory Identities right away:

# If you don't have Ory CLI installed yet:
bash <(curl https://raw.githubusercontent.com/ory/meta/master/install.sh) -b . ory
sudo mv ./ory /usr/local/bin/

# Sign up
ory auth

# Create project
ory create project

Table of Contents

What is Ory Kratos?

Ory Kratos is an API-first Identity and User Management system that is built according to cloud architecture best practices. It implements core use cases that almost every software application needs to deal with:

  • Self-service Login and Registration: Allow end-users to create and sign into accounts (we call them identities) using Username / Email and password combinations, Social Sign In ("Sign in with Google, GitHub"), Passwordless flows, and others.
  • Multi-Factor Authentication (MFA/2FA): Support protocols such as TOTP (RFC 6238 and IETF RFC 4226 - better known as Google Authenticator)
  • Account Verification: Verify that an E-Mail address, phone number, or physical address actually belong to that identity.
  • Account Recovery: Recover access using "Forgot Password" flows, Security Codes (in case of MFA device loss), and others.
  • Profile and Account Management: Update passwords, personal details, email addresses, linked social profiles using secure flows.
  • Admin APIs: Import, update, delete identities.

We highly recommend reading the Ory Kratos introduction docs to learn more about Ory Krato's background, feature set, and differentiation from other products.

Who is using it?

The Ory community stands on the shoulders of individuals, companies, and maintainers. The Ory team thanks everyone involved - from submitting bug reports and feature requests, to contributing patches and documentation. The Ory community counts more than 33.000 members and is growing rapidly. The Ory stack protects 60.000.000.000+ API requests every month with over 400.000+ active service nodes. None of this would have been possible without each and everyone of you!

The following list represents companies that have accompanied us along the way and that have made outstanding contributions to our ecosystem. If you think that your company deserves a spot here, reach out to office@ory.sh now!

Type Name Logo Website
Adopter * Raspberry PI Foundation Raspberry PI Foundation raspberrypi.org
Adopter * Kyma Project Kyma Project kyma-project.io
Adopter * Tulip Tulip Retail tulip.com
Adopter * Cashdeck / All My Funds All My Funds cashdeck.com.au
Adopter * Hootsuite Hootsuite hootsuite.com
Adopter * Segment Segment segment.com
Adopter * Arduino Arduino arduino.cc
Adopter * DataDetect Datadetect unifiedglobalarchiving.com/data-detect/
Adopter * Sainsbury's Sainsbury's sainsburys.co.uk
Adopter * Contraste Contraste contraste.com
Adopter * Reyah Reyah reyah.eu
Adopter * Zero Project Zero by Commit getzero.dev
Adopter * Padis Padis padis.io
Adopter * Cloudbear Cloudbear cloudbear.eu
Adopter * Security Onion Solutions Security Onion Solutions securityonionsolutions.com
Adopter * Factly Factly factlylabs.com
Adopter * Nortal Nortal nortal.com
Adopter * OrderMyGear OrderMyGear ordermygear.com
Adopter * Spiri.bo Spiri.bo spiri.bo
Adopter * Strivacity Spiri.bo strivacity.com
Adopter * Hanko Hanko hanko.io
Adopter * Rabbit Rabbit rabbit.co.th
Adopter * inMusic InMusic inmusicbrands.com
Adopter * Buhta Buhta buhta.com
Adopter * Connctd Connctd connctd.com
Adopter * Paralus Paralus paralus.io
Adopter * TIER IV TIER IV tier4.jp
Adopter * R2Devops R2Devops r2devops.io
Adopter * LunaSec LunaSec lunasec.io
Adopter * Serlo Serlo serlo.org
Adopter * dyrector.io dyrector.io dyrector.io
Adopter * Stackspin stackspin.net stackspin.net
Adopter * Amplitude amplitude.com amplitude.com
Adopter * Pinniped pinniped.dev pinniped.dev
Adopter * Pvotal pvotal.tech pvotal.tech

Many thanks to all individual contributors

* Uses one of Ory's major projects in production.

Getting Started

To get started with some easy examples, head over to the Get Started Documentation.

Installation

Head over to the Ory Developer Documentation to learn how to install Ory Kratos on Linux, macOS, Windows, and Docker and how to build Ory Kratos from source.

Ecosystem

We build Ory on several guiding principles when it comes to our architecture design:

  • Minimal dependencies
  • Runs everywhere
  • Scales without effort
  • Minimize room for human and network errors

Ory's architecture is designed to run best on a Container Orchestration system such as Kubernetes, CloudFoundry, OpenShift, and similar projects. Binaries are small (5-15MB) and available for all popular processor types (ARM, AMD64, i386) and operating systems (FreeBSD, Linux, macOS, Windows) without system dependencies (Java, Node, Ruby, libxml, ...).

Ory Kratos: Identity and User Infrastructure and Management

Ory Kratos is an API-first Identity and User Management system that is built according to cloud architecture best practices. It implements core use cases that almost every software application needs to deal with: Self-service Login and Registration, Multi-Factor Authentication (MFA/2FA), Account Recovery and Verification, Profile, and Account Management.

Ory Hydra: OAuth2 & OpenID Connect Server

Ory Hydra is an OpenID Certified™ OAuth2 and OpenID Connect Provider which easily connects to any existing identity system by writing a tiny "bridge" application. It gives absolute control over the user interface and user experience flows.

Ory Oathkeeper: Identity & Access Proxy

Ory Oathkeeper is a BeyondCorp/Zero Trust Identity & Access Proxy (IAP) with configurable authentication, authorization, and request mutation rules for your web services: Authenticate JWT, Access Tokens, API Keys, mTLS; Check if the contained subject is allowed to perform the request; Encode resulting content into custom headers (X-User-ID), JSON Web Tokens and more!

Ory Keto: Access Control Policies as a Server

Ory Keto is a policy decision point. It uses a set of access control policies, similar to AWS IAM Policies, in order to determine whether a subject (user, application, service, car, ...) is authorized to perform a certain action on a resource.

Security

Running identity infrastructure requires attention and knowledge of threat models.

Disclosing vulnerabilities

If you think you found a security vulnerability, please refrain from posting it publicly on the forums, the chat, or GitHub. You can find all info for responsible disclosure in our security.txt.

Telemetry

Ory's services collect summarized, anonymized data that can optionally be turned off. Click here to learn more.

Documentation

Guide

The Guide is available here.

HTTP API documentation

The HTTP API is documented here.

Upgrading and Changelog

New releases might introduce breaking changes. To help you identify and incorporate those changes, we document these changes in the CHANGELOG.md. For upgrading, please visit the upgrade guide.

Command line documentation

Run kratos -h or kratos help.

Develop

We encourage all contributions and encourage you to read our contribution guidelines

Dependencies

You need Go 1.16+ and (for the test suites):

  • Docker and Docker Compose
  • Makefile
  • NodeJS / npm

It is possible to develop Ory Kratos on Windows, but please be aware that all guides assume a Unix shell like bash or zsh.

Install from source

make install

Formatting Code

You can format all code using make format. Our CI checks if your code is properly formatted.

Running Tests

There are three types of tests you can run:

  • Short tests (do not require a SQL database like PostgreSQL)
  • Regular tests (do require PostgreSQL, MySQL, CockroachDB)
  • End to end tests (do require databases and will use a test browser)
Short Tests

Short tests run fairly quickly. You can either test all of the code at once

go test -short -tags sqlite ./...

or test just a specific module:

cd client; go test -tags sqlite -short .
Regular Tests

Regular tests require a database set up. Our test suite is able to work with docker directly (using ory/dockertest) but we encourage to use the Makefile instead. Using dockertest can bloat the number of Docker Images on your system and are quite slow. Instead we recommend doing:

make test

Please be aware that make test recreates the databases every time you run make test. This can be annoying if you are trying to fix something very specific and need the database tests all the time. In that case we suggest that you initialize the databases with:

make test-resetdb
export TEST_DATABASE_MYSQL='mysql://root:secret@(127.0.0.1:3444)/mysql?parseTime=true'
export TEST_DATABASE_POSTGRESQL='postgres://postgres:secret@127.0.0.1:3445/kratos?sslmode=disable'
export TEST_DATABASE_COCKROACHDB='cockroach://root@127.0.0.1:3446/defaultdb?sslmode=disable'

Then you can run go test as often as you'd like:

go test -tags sqlite ./...

# or in a module:
cd client; go test  -tags sqlite  .
Updating Test Fixtures

Some tests use fixtures. If payloads change, you can update them with:

make test-update-snapshots

This will only update the snapshots of the short tests. To update all snapshots, run:

UPDATE_SNAPSHOTS=true go test -p 4 -tags sqlite ./...

You can also run this command from a sub folder.

End-to-End Tests

We use Cypress to run our e2e tests.

⚠️ To run Cypress on ARM based Mac's, at the moment it is necessary to install Rosetta 2. To install, use the command - softwareupdate --install-rosetta --agree-to-license

The simplest way to develop e2e tests is:

./test/e2e/run.sh --dev sqlite

You can run all tests (with databases) using:

make test-e2e

For more details, run:

./test/e2e/run.sh

Run only a singular test

Add .only to the test you would like to run.

For example:

it.only('invalid remote recovery email template', () => {
    ...
})

Run a subset of tests

This will require editing the cypress.json file located in the test/e2e/ folder.

Add the testFiles option and specify the test to run inside the cypress/integration folder. As an example we will add only the network tests.

"testFiles": ["profiles/network/*"],

Now start the tests again using the run script or makefile.

Build Docker

You can build a development Docker Image using:

make docker

Preview API documentation

  • update the SDK including the OpenAPI specification: make sdk
  • run preview server for API documentation: make docs/api
  • run preview server for swagger documentation: make docs/swagger