Skip to content

Commit

Permalink
feat: write tests and fix bugs for oidc settings
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed May 15, 2020
1 parent 3e98756 commit 575a61f
Show file tree
Hide file tree
Showing 27 changed files with 1,397 additions and 186 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- TEST_MAILHOG_API=http://127.0.0.1:8025
- TEST_SELFSERVICE_OIDC_HYDRA_ADMIN=http://127.0.0.1:4445
- TEST_SELFSERVICE_OIDC_HYDRA_PUBLIC=http://127.0.0.1:4444
- TEST_SELFSERVICE_OIDC_HYDRA_INTEGRATION_ADDR=127.0.0.1:4499
- TEST_SELFSERVICE_OIDC_HYDRA_INTEGRATION_ADDR=http://127.0.0.1:4499
- TEST_DATABASE_POSTGRESQL=postgres://test:test@localhost:5432/postgres?sslmode=disable
- TEST_DATABASE_MYSQL=mysql://root:test@(localhost:3306)/mysql?parseTime=true&multiStatements=true
- TEST_DATABASE_COCKROACHDB=cockroach://root@localhost:26257/defaultdb?sslmode=disable
Expand Down
55 changes: 54 additions & 1 deletion docs/docs/concepts/selfservice-flow-completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ successful response modes:

Browser requests, identified by the `Accept: text/html` header, complete with a
redirection flow. If no redirection URL is set for the flow, the Default
Redirect URL will be used:
Redirect URL will be used for most flows (e.g. login, registration):

```yaml file="path/to/my/kratos.config.yml"
urls:
Expand Down Expand Up @@ -61,6 +61,59 @@ urls:
- https://www.myapp.com/
```
### Post-Login Redirection
Post-login redirection considers the following configuration keys:
```yaml file="path/to/my/kratos.config.yml"
urls:
default_redirect_to: https://end-up-here-per-default/

selfservice:
login:
after:
# overrides url.default_redirect_to
default_redirect_to: https://this-is-overridden-by-password/
password:
# overrides selfservice.login.after.default_redirect_to
default_redirect_to: https://end-up-here-after-login-with-password/
```
### Post-Registration Redirection
Post-login redirection considers the following configuration keys:
```yaml file="path/to/my/kratos.config.yml"
urls:
default_redirect_to: https://end-up-here-per-default/

selfservice:
registration:
after:
# overrides url.default_redirect_to
default_redirect_to: https://this-is-overridden-by-password/
password:
# overrides selfservice.registration.after.default_redirect_to
default_redirect_to: https://end-up-here-after-registration-with-password/
```
### Post-Settings Redirection
Post-settings redirection **does not use** the `urls.default_redirect_to` configuration key. Instead
the redirect ends at the same Settings UI with the same Settings Request ID and key `update_successful`
set to `true`. If the listed keys are set, the redirection will end up at the specified values:

```yaml file="path/to/my/kratos.config.yml"
selfservice:
settings:
after:
# overrides url.default_redirect_to
default_redirect_to: https://this-is-overridden-by-password/
password:
# overrides selfservice.settings.after.default_redirect_to
default_redirect_to: https://end-up-here-after-settings-with-password/
```

## JSON

This feature is currently in prototype phase and will be documented at a later
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ $ make quickstart
To set up "Sign in with GitHub" you must create a
[GitHub OAuth2 Client](https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/)
and set the "Authorization callback URL" to
`http://127.0.0.1:4455/.ory/kratos/public/self-service/browser/flows/registration/strategies/oidc/callback/github`.
`http://127.0.0.1:4455/.ory/kratos/public/self-service/browser/flows/strategies/oidc/callback/github`.
The pattern of this URL is
`http(s)://<domain-of-ory-kratos>:<public-port>/self-service/browser/flows/registration/strategies/oidc/callback/<provider-id>`.
`http(s)://<domain-of-ory-kratos>:<public-port>/self-service/browser/flows/strategies/oidc/callback/<provider-id>`.
The provider ID must point to the provider's ID set in the ORY Kratos
configuration file (explained in paragraphs).

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions internal/httpclient/client/public/public_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions internal/httpclient/models/errors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 575a61f

Please sign in to comment.