alexa / ask-toolkit-for-vscode

ASK Toolkit is an extension for Visual Studio Code (VSC) that that makes it easier for developers to develop and deploy Alexa Skills.
https://developer.amazon.com/en-US/docs/alexa/ask-toolkit/get-started-with-the-ask-toolkit-for-visual-studio-code.html
Apache License 2.0
108 stars 52 forks source link

fix: use localhost instead of 127.0.0.1 for LWA redirect #197

Closed tydonelson closed 2 years ago

tydonelson commented 2 years ago

Use localhost instead 127.0.0.1 for WSL support

Description

Re-introducing the changes to use localhost in the redirect URL for LWA authentication, rather than 127.0.0.1.

The changes were initially introduced here and reverted here.

Motivation and Context

This allows the redirect to go through successfully for WSL users.

For context, these changes were introduced in version 2.11.2 of the extension but were backed out, as it caused an issue for new profiles when attempting to authenticate. The redirect URL whitelist in the existing security profile was not configured to allow for localhost:9090. We have since updated the configuration and can move ahead with this change (testing details below).

Testing

Downgraded extension to 2.11.2, where the changes (and localhost redirect failure) were first introduced: image

Created a new profile: image

Signed in to the LWA portal, redirect URL is now showing localhost and is successful: image image

We are also getting the success response in VSCode: image

Unit tests successful: image

Screenshots (if appropriate)

Types of changes

Checklist

License