Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: refactoring example to using Kratos SelfService UI Node Docker image #73

Merged
merged 1 commit into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading