Hey there, we are using Ory Network with Google so...
# ory-network
f
Hey there, we are using Ory Network with Google social sign in enabled. The google auth screen does show oryapis.com as redirect domain. Is there a way to change it to our custom domain?
f
what did you set for the Redirect URI (Console: "Use this value during your OAuth2 client registration on Google's side. It's where the user will be redirected after authentication is successful.")
you may need to change that from your oryapis.com domain to your custom domain
f
There is this text field “Redirect URI”, but it’s disabled and holds the Ory project url. When I change the redirect url at Google with a modified url (replace the ory project url with our custom domain) it isn’t working anymore. Seems that these 2 values for “Redirect URL” must be the same at Ory and Google.
Let me post a screenshot of the Ory UI to be more clear which “Field”
f
@steep-lamp-91158 do you know what's going on there?
s
yes, that has to be our domain right now AFAIK @high-optician-2097 might know if you can change that
h
Oh, is there no way to customize this on the Google end?
We have set it to oryapis.com so that if you change your custom domain, you don’t need to reconfigure all the oauth2 clients
f
Ok, I have tried that but the login process did not work after changing the settings at Google. Let me retry and post the error message.
This is what I get
For me it seems I should be able to change the Redirect URI value at Ory console… but it is read-only
h
Ok, you can overwrite it manually but it’s not really recommended. My question was if you can change the consent screen of google, there’s a couple of options, maybe you can properly add your brand there?
Sorry, this is the first time we noticed this. But we’ll get it resolved!
For us it’s configured like this:
f
unfortunately we already have a similar configuration and there was nothing to improve. thanks so far, I guess we would need the ability to customize the redirect URI to see another domain name at the auth screen. As an idea you could make an option in the UI to choose between ory project or custom domains.
h
Ok, that is definitely possible using the Ory CLI. Basically what you have to do is to change the
selfservice.methods.oidc.config.base_redirect_uri
value. You should add your custom domain there, so e.g.
<https://auth.example.org>
. I don’t think trailing slashes matter here, but let’s omit it. You can change the config value using the Ory CLI. There is docs on this here: https://www.ory.sh/docs/guides/cli/identity-cli You can either do this by exporting the YAML, changing the relevant part, and importing. Or by using patch. I guess it would be something along the lines of:
Copy code
ory patch identity-config <project-id> \
  --replace '/selfservice/methods/oidc/config/base_redirect_uri="<https://auth.example.org>"'
If replace does not work (the patch API needs a bit of work on our end for better resilience …) you can try add:
Copy code
ory patch identity-config <project-id> \
  --add '/selfservice/methods/oidc/config/base_redirect_uri="<https://auth.example.org>"'
Please be aware that this will impact all your oauth2 redirect URLs and social sign in providers. It also means that we can not fix the value for you if something changes with regards to your custom domain etc. We do have tests for this case, but we try to keep it streamlined for most projects. So maybe add this to some internal documentation that this is how you changed it so that others in your team know :)
I think this should do the trick, if not, let me know
@wonderful-lamp-2357 if this works, is it something we should add to the docs? this seems to affect primarily google social sign in as they show the redirect hostname. i think this is a recent change on their end too. we currently have no plans to change the redirect scheme for social sign in, but the above could be a guide for users to work around this limitation
w
Sure, can add this to the Google social sign-in document. Just need to digest this thread to understand what this is about and come up with a good way of explaining this 👍
👍 2
f
Thank all of you, I will try that workaround via CLI
h
let us know how it goes! we’re here for you :)
m
Do you have this tracked somewhere @wonderful-lamp-2357? The question just came up again.
Hey @faint-tent-43897 apologies for the late followup, but did this work for you?
f
This is working, and so far no issues or sideffects. I’ve downloaded the identity-config, changed it locally, then updated.
ory update identity-config ...
👍 2