Skip to content

Commit

Permalink
fix: issue when generate-lwa-tokens fails when scopes not specified w…
Browse files Browse the repository at this point in the history
…ith custom client id and secret (#322)
  • Loading branch information
kakhaUrigashvili authored Oct 19, 2020
1 parent e7d9730 commit dfd1c23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/commands/util/generate-lwa-tokens/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class GenerateLwaTokensCommand extends AbstractCommand {
auth_client_type: 'LWA',
clientId: cmd.clientId,
clientConfirmation: cmd.clientConfirmation,
scope: cmd.scopes,
scope: cmd.scopes || CONSTANTS.LWA.DEFAULT_PUBLIC_SCOPES,
doDebug: cmd.debug
}; // redirect_url must be pre-set depending on the CLI mode and with the trusted domain

Expand Down
7 changes: 5 additions & 2 deletions lib/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,14 @@ const SCOPES_CATALOG_READWRITE = 'alexa::ask:catalogs:readwrite';
const SCOPES_SUBSCRIPTIONS = 'alexa::ask:subscriptions';
const SCOPES_SKILLS_DEBUG = 'alexa::ask:skills:debug';

const DEFAULT_PUBLIC_SCOPES = `${SCOPES_SKILLS_READWRITE} ${SCOPES_MODELS_READWRITE} ${SCOPES_SKILLS_TEST} ${SCOPES_CATALOG_READ}`
+ ` ${SCOPES_CATALOG_READWRITE} ${SCOPES_SUBSCRIPTIONS}`;

module.exports.LWA = {
S3_RESPONSE_PARSER_URL: 'https://ask-cli-static-content.s3-us-west-2.amazonaws.com/html/ask-cli-no-browser.html',
DEFAULT_STATE: 'Ask-SkillModel-ReadWrite',
DEFAULT_SCOPES: `${SCOPES_SKILLS_READWRITE} ${SCOPES_MODELS_READWRITE} ${SCOPES_SKILLS_TEST} ${SCOPES_CATALOG_READ}`
+ ` ${SCOPES_CATALOG_READWRITE} ${SCOPES_SUBSCRIPTIONS} ${SCOPES_SKILLS_DEBUG}`,
DEFAULT_PUBLIC_SCOPES,
DEFAULT_SCOPES: `${DEFAULT_PUBLIC_SCOPES} ${SCOPES_SKILLS_DEBUG}`,
SIGNIN_URL: 'https://www.amazon.com/ap/signin',
// Below are the details for the ask-cli's default LWA client which is used internally if another client is not provided by the users.
// Use of this client outside of the CLI is unauthorized and unsupported by Amazon.
Expand Down

0 comments on commit dfd1c23

Please sign in to comment.