Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AudioPlayer requests failing at application ID verification #30

Closed
rking788 opened this issue Dec 12, 2017 · 1 comment
Closed

AudioPlayer requests failing at application ID verification #30

rking788 opened this issue Dec 12, 2017 · 1 comment

Comments

@rking788
Copy link
Contributor

AudioPlayer requests sent to inform the skill server about playback state changes do not include a Session object since they are not tied to a user session, leading to an automatic 400 response. This means the application ID is passed in the context property of the request. This application ID should be used for the verification step in addition to the session object to cover all the bases.

More information about these playback state requests can be found here:
https://developer.amazon.com/docs/custom-skills/audioplayer-interface-reference.html#requests

rking788 added a commit to rking788/go-alexa that referenced this issue Dec 12, 2017
… context field.

This allows the server to check the context for the application ID to be verified
during AudioPlayback requests instead of automatically returning a 400 response
when the session property is not available.

Fixes mikeflynn#30
@rking788
Copy link
Contributor Author

So I posted a pull request for this without testing it as thoroughly as I should have. It seems like the logic in the skillserver.go file will need to be changed as well. The issue now is that the checks in for the request type are now failing since the request is not one of IntentRequest, LaunchRequest, or SessionEndedRequest. Here is a sample playback request:

{
    "version": "1.0",
    "context": {
        "AudioPlayer": {
            "offsetInMilliseconds": 0,
            "token": "12345",
            "playerActivity": "PLAYING"
        },
        "System": {
            "application": {
                "applicationId": "<REDACTED>"
            },
            "user": {
                "userId": "<REDACTED>",
                "accessToken": "<REDACTED>"
            },
            "device": {
                "deviceId": "<REDACTED>",
                "supportedInterfaces": {
                    "AudioPlayer": {}
                }
            },
            "apiEndpoint": "https://api.amazonalexa.com",
            "apiAccessToken": "<REDACTED>"
        }
    },
    "request": {
        "type": "AudioPlayer.PlaybackStarted",
        "requestId": "<REDACTED>",
        "timestamp": "2017-12-12T02:50:17Z",
        "locale": "en-US",
        "token": "12345",
        "offsetInMilliseconds": 0
    }
}

rking788 added a commit to rking788/go-alexa that referenced this issue Dec 12, 2017
… context field.

This allows the server to check the context for the application ID to be verified
during AudioPlayback requests instead of automatically returning a 400 response
when the session property is not available.

Fixes mikeflynn#30
rking788 added a commit to rking788/go-alexa that referenced this issue Oct 17, 2018
… context field.

This allows the server to check the context for the application ID to be verified
during AudioPlayback requests instead of automatically returning a 400 response
when the session property is not available.

Fixes mikeflynn#30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant