poc-kratos-hydra

command module
v0.0.0-...-0fc1b25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

README

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 ...

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
log

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL