check appid
This commit is contained in:
@@ -7,6 +7,7 @@ using AlexaSkillsKit.Authentication;
|
||||
using AlexaSkillsKit.Json;
|
||||
using System.Threading.Tasks;
|
||||
using AlexaSkillsKit.UI;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace alexa.dev.excuses
|
||||
{
|
||||
@@ -24,6 +25,16 @@ namespace alexa.dev.excuses
|
||||
return CompileResponse();
|
||||
}
|
||||
|
||||
public override bool OnRequestValidation(SpeechletRequestValidationResult result, DateTime referenceTimeUtc, SpeechletRequestEnvelope requestEnvelope)
|
||||
{
|
||||
if(!string.IsNullOrWhiteSpace(requestEnvelope?.Session?.Application?.Id) && !requestEnvelope.Session.Application.Id.Equals("amzn1.ask.skill.2327a089-3c06-47f7-accb-4b627136b652"))
|
||||
{
|
||||
WebApiApplication.telemetry.TrackEvent("Request envelope does not contain the appid");
|
||||
return false;
|
||||
}
|
||||
return base.OnRequestValidation(result, referenceTimeUtc, requestEnvelope);
|
||||
}
|
||||
|
||||
public override void OnSessionEnded(SessionEndedRequest sessionEndedRequest, Session session)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Microsoft.ApplicationInsights;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
@@ -9,6 +10,7 @@ namespace alexa.dev.excuses
|
||||
{
|
||||
public class WebApiApplication : System.Web.HttpApplication
|
||||
{
|
||||
public static TelemetryClient telemetry = new TelemetryClient() { InstrumentationKey = "69bdd5ac-c992-4daa-89c9-7af1dbd09249" };
|
||||
protected void Application_Start()
|
||||
{
|
||||
GlobalConfiguration.Configure(WebApiConfig.Register);
|
||||
|
||||
Reference in New Issue
Block a user