9

How can I remove a redirect uri using amplify.

Running amplify auth update gives no option for removing a redirect uri, there is only a 'add/edit' option. I have tried to look through the documentation but with no success.

Axel Olivecrona
  • 143
  • 2
  • 6
  • I just found this [issue](https://github.com/aws-amplify/amplify-js/issues/3895) on github, it might solve my issue. Will report back with the result – Axel Olivecrona Nov 14 '19 at 08:40
  • So I solved my problem with the github issue linked above. I ended up ignoring the uri(s) added in amplify since they don't seem to be supported in the aws javascript api. Since I ignore the uris added in the aws amplify api it does not really matter if I cant remove them – Axel Olivecrona Nov 14 '19 at 13:55

5 Answers5

12

While it doesn't seem to be possible to remove redirects using the amplify CLI, you can do it manually by editing the (multiple) parameters.json files that amplify creates. Search for the CallbackURLs and LogoutURLs fields in the oAuthMetadata and you can manually delete the sign in/sign out redirects that you no longer want.

Sam
  • 129
  • 3
1

there are 2 places where you need to update the signin and signout urls to avoid breaking the backend build:

aws-exports.js, which is usually located in the root of your project.

parameters.json of the amplify/backend/auth/appname folder

glls
  • 2,325
  • 1
  • 22
  • 39
0

Modify parameters.json seems not working. Instead, modify cli-inputs.json. It's in the path amplify/backend/ of your folder. Search for the CallbackURLs and LogoutURLs fields in the oAuthMetadata, and manually edit it.

After that amplify push will work, it will update the local's file: parameters.json and aws-export.js, and also update the Cognito's (backend) side.

By the way, if you use amplify hosting, you should build your frontend(e.g. git push if you link the repo) to sync the confi file for frontend application.

Po Lai
  • 1
0

The easiest way is to:

  1. amplify update auth
  2. select Add/Edit signin and signout redirect URIs
  3. Modify the uri you want to remove to something like {your_app_name}://callback_to_remove
  4. Search the files containing callback_to_remove in your project and remove the uri.
  5. amplify push
-4

Hi There I am sure you have probably figured it by now or they have recently added this option but in the backend, you can click on the bottom option rewrites and redirects.

Image showing the option for rewrites and redirects

Jon
  • 1,328
  • 1
  • 11
  • 11