I can't see a way to add `post_logout_redirect_ur...
# ory-network
g
I can't see a way to add
post_logout_redirect_uris
to my oauth client on Ory console. There is this section for redirect URIs, but this doesn't seem to add the URIs to the whitelist for
post_logout_redirect_uris
? I am getting an error after doing an oauth signout redirect even though the URI I'm providing has been added via this part of the console?
p
Hi @gray-shoe-60285 You would need to use the Ory CLI to add the value, since we unfortunately don't have an option in the console yet. https://www.ory.sh/docs/oauth2-oidc/oidc-logout#redirect-after-logout https://www.ory.sh/docs/guides/cli/config-with-cli#patch-configuration To get the project config just call the Ory CLI:
Copy code
ory get project <project-id> --format yaml > config.yaml
You can also patch the
post_logout_redirect_uris
directly like so:
Copy code
ory patch project <project-id> --replace '/services/oauth2/config/urls/post_logout_redirect="<https://example.com>"'
g
Thanks I have patched the `
Copy code
'/services/oauth2/config/urls/post_logout_redirect="<https://example.com>"'
value and can see it has updated:
I am still getting the same error however when including the same error when including the
post_logout_redirect_uri
parameter in the logout request.
I need to set a multiple
post_logout_redirect_uris
and may be missing how this would work with the example you shared?
Copy code
ory patch project <project-id> --replace '/services/oauth2/config/urls/post_logout_redirect="<https://example.com>"'
I have tried to add the following to a few places in the oauth2 config
Copy code
post_logout_redirect_uris:
  - <https://local.example.com:3000/oauth>
  - <https://app.example.com/oauth>
but this is just ignored when I use the update command?
This was another approach I tried, but got an error even though the url are listed as redirect uri:
p
Hi Brandon, the client needs to add the URL to their
post_logout_redirect_uris
list and the project config needs to add the
post_logout_redirect_uri
value. https://www.ory.sh/docs/oauth2-oidc/oidc-logout#redirect-after-logout
g
To patch
post_logout_redirect_uris
on the client It doesnt look like you can use the ory CLI? https://www.ory.sh/docs/hydra/guides/oauth2-clients#patch-oauth2-client
I have tried to create a client with the
post_logout_redirect_uris
list, but the CLI doesn't have this flag? I can see you can include
post_logout_redirect_uris
when using the API? https://www.ory.sh/docs/reference/api#tag/oAuth2/operation/createOAuth2Client Is this a limitation of the ory CLI?
p
I've looked into the code a bit and I don't see the
post_logout_redirect_uris
flag in the CLI. https://github.com/ory/hydra/blob/master/cmd/cmd_create_client.go I will create an issue and see to add it. Sorry about this inconvenience 🙇‍♂️
You can track the issue here https://github.com/ory/network/issues/337
g
No problem Alano, thanks for getting back to me with that and opening an issue!
c
👋 I've been experiencing the same troubles setting this
post_logout_redirect_uris
. I've also noticed we could use the HTTP API to patch the oauth client (https://www.ory.sh/docs/reference/api#tag/oAuth2/operation/patchOAuth2Client) where we could update this configuration. I've tried doing it but I got a HTTP 500 while trying to do so:
Copy code
curl --request PATCH \
  --url https://{project_slug}.<http://projects.oryapis.com/admin/clients/{clientId}|projects.oryapis.com/admin/clients/{clientId}> \
  --header 'Authorization: Bearer XXX' \
  --header 'Content-Type: application/json' \
  --data '[
	{
		"op": "add",
		"path": "/post_logout_redirect_uris",
		"value": "whatever"
	}
]'
Is there any way we could do this from the Ory HTTP API (as an alternative to using the CLI)?