monkjunior / poc-kratos-hydra

Testing integration between ory kratos and hydra

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Proof of concept for integration between kratos and hydra

Run this POC

Start docker-compose stack

$ make start-all

A login and consent app will be served at http://127.0.0.1:4455/

Create the first Hydra client

$ make create-hydra-client

Start an exemplary client to perform OAuth2 Authorization Code flow.

$ make examine-authorization-code

Visit the client at http://127.0.0.1:5555

From here, if we access http://127.0.0.1:5555/mock/api, it will print out all the headers. It also contains some custom headers which are produced from Oathkeeper like:

  • Authorization: bear ...
  • X-User-ID: ... It is quite easy to add more custom header if you want.

Rebuild and update UI service:

$ make update-ui

Clean example:

$ make clean-all

My personal docs for this example

OIDC and Hydra

Kratos configuration

Discussions about this topic:

References, libs and packages

Cookies vs Tokens

Golang client package:

  • Kratos

  • Hydra golang SDK

  • Enable OpenID connect support for golang.org/x/oauth2 by using github.com/coreos/go-oidc

Protected endpoints by using OathKeeper, all requests come to these APIs must be authenticated.

How to ...

About

Testing integration between ory kratos and hydra

License:Apache License 2.0


Languages

Language:Go 95.3%Language:Makefile 2.5%Language:Jsonnet 1.0%Language:Dockerfile 0.8%Language:CSS 0.4%