Skip to content

Commit

Permalink
refactor(kratos-hydra-example): refactoring example to using Kratos S…
Browse files Browse the repository at this point in the history
…elfService UI Node Docker image
  • Loading branch information
Jorgagu committed Jul 21, 2023
1 parent 2face08 commit 170cd5f
Show file tree
Hide file tree
Showing 82 changed files with 61 additions and 14,401 deletions.
3 changes: 0 additions & 3 deletions kratos-hydra/.dockerignore

This file was deleted.

109 changes: 0 additions & 109 deletions kratos-hydra/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions kratos-hydra/.npmignore

This file was deleted.

7 changes: 0 additions & 7 deletions kratos-hydra/.prettierignore

This file was deleted.

3 changes: 0 additions & 3 deletions kratos-hydra/.reference-ignore

This file was deleted.

28 changes: 0 additions & 28 deletions kratos-hydra/Dockerfile

This file was deleted.

17 changes: 0 additions & 17 deletions kratos-hydra/Dockerfile-dev

This file was deleted.

60 changes: 0 additions & 60 deletions kratos-hydra/Makefile

This file was deleted.

44 changes: 40 additions & 4 deletions kratos-hydra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ You'll need the following software to run this example:

The example uses the following environment variables:

- DATABASE_URL: The URL of the database used by Ory Kratos

- PUBLIC_PORT: The public port of the Ory Hydra server

- ADMIN_PORT: The admin port of the Ory Hydra server
Expand All @@ -52,11 +50,49 @@ URLS_SELF_ISSUER=http://localhost:4445/
To run the example locally, clone the repository and run the following commands
in the root of the project:

```
```shell script
docker-compose up
```

This will start the Ory Hydra and Ory Kratos servers in Docker containers.
This will start the Ory Hydra, Ory Kratos, Kratos SelfService UI Node servers in
Docker containers.

Next, create an OAuth2 client and store its data in variable

```shell script
code_client=$(docker-compose exec hydra \
hydra create client \
--endpoint http://127.0.0.1:4445 \
--grant-type authorization_code,refresh_token \
--response-type code,id_token \
--format json \
--scope openid --scope offline \
--redirect-uri http://127.0.0.1:5555/callback)
```

Store OAuth2 client identifier and secret in variables

```shell script
code_client_id=$(echo $code_client | jq -r '.client_id')
```

```shell script
code_client_secret=$(echo $code_client | jq -r '.client_secret')
```

And perform an OAuth2 Authorize Code Flow

```shell script
docker-compose exec hydra \
hydra perform authorization-code \
--client-id $code_client_id \
--client-secret $code_client_secret \
--endpoint http://127.0.0.1:4444/ \
--port 5555 \
--scope openid --scope offline
```

And navigate to http://127.0.0.1:5555 in your browser

### Run tests

Expand Down
38 changes: 0 additions & 38 deletions kratos-hydra/contrib/hydra/README.md

This file was deleted.

22 changes: 0 additions & 22 deletions kratos-hydra/contrib/hydra/pg-init/pg-init.sh

This file was deleted.

3 changes: 0 additions & 3 deletions kratos-hydra/contrib/sdk/.gitignore

This file was deleted.

Loading

0 comments on commit 170cd5f

Please sign in to comment.