Class: AWSCDK::AlexaAsk::CfnSkill::AuthenticationConfigurationProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
alexa_ask/cfn_skill.rb

Overview

The AuthenticationConfiguration property type specifies the Login with Amazon (LWA) configuration used to authenticate with the Alexa service.

Only Login with Amazon security profiles created through the are supported for authentication. A client ID, client secret, and refresh token are required. You can generate a client ID and client secret by creating a new on the Amazon Developer Portal or you can retrieve them from an existing profile. You can then retrieve the refresh token using the Alexa Skills Kit CLI. For instructions, see in the .

AuthenticationConfiguration is a property of the Alexa::ASK::Skill resource.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client_id:, client_secret:, refresh_token:) ⇒ AuthenticationConfigurationProperty

Returns a new instance of AuthenticationConfigurationProperty.

Parameters:

  • client_id (String)

    Client ID from Login with Amazon (LWA).

  • client_secret (String)

    Client secret from Login with Amazon (LWA).

  • refresh_token (String)

    Refresh token from Login with Amazon (LWA).



534
535
536
537
538
539
540
541
# File 'alexa_ask/cfn_skill.rb', line 534

def initialize(client_id:, client_secret:, refresh_token:)
  @client_id = client_id
  Jsii::Type.check_type(@client_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "clientId")
  @client_secret = client_secret
  Jsii::Type.check_type(@client_secret, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "clientSecret")
  @refresh_token = refresh_token
  Jsii::Type.check_type(@refresh_token, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "refreshToken")
end

Instance Attribute Details

#client_idString (readonly)

Client ID from Login with Amazon (LWA).



547
548
549
# File 'alexa_ask/cfn_skill.rb', line 547

def client_id
  @client_id
end

#client_secretString (readonly)

Client secret from Login with Amazon (LWA).



552
553
554
# File 'alexa_ask/cfn_skill.rb', line 552

def client_secret
  @client_secret
end

#refresh_tokenString (readonly)

Refresh token from Login with Amazon (LWA).

This token is secret.



559
560
561
# File 'alexa_ask/cfn_skill.rb', line 559

def refresh_token
  @refresh_token
end

Class Method Details

.jsii_propertiesObject



561
562
563
564
565
566
567
# File 'alexa_ask/cfn_skill.rb', line 561

def self.jsii_properties
  {
    :client_id => "clientId",
    :client_secret => "clientSecret",
    :refresh_token => "refreshToken",
  }
end

Instance Method Details

#to_jsiiObject



569
570
571
572
573
574
575
576
577
# File 'alexa_ask/cfn_skill.rb', line 569

def to_jsii
  result = {}
  result.merge!({
    "clientId" => @client_id,
    "clientSecret" => @client_secret,
    "refreshToken" => @refresh_token,
  })
  result.compact
end