hydra icon indicating copy to clipboard operation
hydra copied to clipboard

Error : The "redirect_uri" parameter does not match any of the OAuth 2.0 Client's pre-registered redirect urls

Open nishaantchauhan opened this issue 7 years ago • 1 comments

During installation of OAuth 2.0 following https://www.ory.sh/docs/next/oathkeeper/configure-deploy on a server side using only docker command.

I have changed required localhost and callback with 172.18.0.1 IP address. when the execution complete the page looks like this. image when i check the Authorized applications generated URL the redirect URL is different compare to i set. i set the 172.18.0.1 but i get 127.0.0.1

href="https://172.18.0.1:9000/oauth2/auth?audience=&client_id=facebook-photo-backup&max_age=0&nonce=lgtwvlsjziflrxdokpjarzfs&prompt=&redirect_uri=http%3A%2F%2F127.0.0.1%3A9010%2Fcallback&response_type=code&scope=openid+offline+photos.read&state=trnvakogbeakqsdlopsgbjvl"

So how can i solve this issue ? May be callback URL is harcoded. if it's not than there is no information in tutorial about this issue.

nishaantchauhan avatar Dec 21 '18 12:12 nishaantchauhan

You linked to the oathkeeper docs and did not provide a way to reproduce the issue. But my guess is that you're still using hydra token user to perform the oauth2 example:

$ docker run --rm -it \
  --network hydraguide \
  -p 9010:9010 \
  oryd/hydra:v1.0.0-rc.4_oryOS.9 \
  token user --skip-tls-verify \
    --port 9010 \
    --auth-url https://localhost:9000/oauth2/auth \
    --token-url https://ory-hydra-example--hydra:4444/oauth2/token \
    --client-id facebook-photo-backup \
    --client-secret some-secret \
    --scope openid,offline,photos.read

If you'd execute the help command

$ docker run --rm -it \
  --network hydraguide \
  -p 9010:9010 \
  oryd/hydra:v1.0.0-rc.4_oryOS.9 \
  token user --help \

You would see that there is a flag called --redirect which allows you to set the redirect url.

aeneasr avatar Dec 21 '18 14:12 aeneasr