Unable to debug my remote event receiver using ngrok.Error "Localhost is not the intended audience”"

%3CLINGO-SUB%20id%3D%22lingo-sub-401326%22%20slang%3D%22en-US%22%3EUnable%20to%20debug%20my%20remote%20event%20receiver%20using%20ngrok.Error%20%22Localhost%20is%20not%20the%20intended%20audience%E2%80%9D%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-401326%22%20slang%3D%22en-US%22%3E%3CP%3EI%20want%20to%20debug%20our%20remote%20event%20receiver%20for%20a%20sharepoint%20online%20site%20collection.%20and%20since%20the%20azure%20service%20bus%20appraoch%20for%20debugging%20RER%20is%20not%20supported%20anymore.%20so%20i%20am%20trying%20to%20use%20the%20ngrok%20appraoch.%20I%20did%20these%20steps%3A-%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3E1-%3C%2FSTRONG%3E%20Inside%20Visual%20Studio%202015%20%26gt%3B%26gt%3B%20create%20new%20sharepoint%20add-in%20%26gt%3B%26gt%3B%20type%20provider-hosted%20Add-in%20%26gt%3B%26gt%3B%20I%20enter%20the%20url%20for%20a%20test%20enterprise%20wiki%20site%20collection%20which%20have%20the%20Sideloading%20of%20apps%20feature%20enabled.%20%3CA%20href%3D%22https%3A%2F%2Fi.stack.imgur.com%2FpAv25.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fi.stack.imgur.com%2FpAv25.png%22%20alt%3D%22enter%20image%20description%20here%22%20border%3D%220%22%20%2F%3E%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3E2-%3C%2FSTRONG%3E%20Then%20i%20enabled%20the%20handle%20Add-in%20installed%2Funinstalled%3A-%20%3CA%20href%3D%22https%3A%2F%2Fi.stack.imgur.com%2F2ReFp.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fi.stack.imgur.com%2F2ReFp.png%22%20alt%3D%22enter%20image%20description%20here%22%20border%3D%220%22%20%2F%3E%3C%2FA%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E3-%3C%2FSTRONG%3E%20Then%20inside%20the%20AppEventReceiver.svc%20i%20entered%20code%20this%20code%20%2B%20the%20methods%20implementation%3A-%3C%2FP%3E%3CPRE%3E%3CSPAN%20class%3D%22kwd%22%3Epublic%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22typ%22%3ESPRemoteEventResult%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22typ%22%3EProcessEvent%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3ESPRemoteEventProperties%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20properties%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E)%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22pun%22%3E%7B%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22typ%22%3ESPRemoteEventResult%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20result%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kwd%22%3Enew%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22typ%22%3ESPRemoteEventResult%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E()%3B%3C%2FSPAN%3E%0A%0A%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kwd%22%3Eswitch%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Eproperties%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EEventType%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E)%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22pun%22%3E%7B%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kwd%22%3Ecase%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22typ%22%3ESPRemoteEventType%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EAppInstalled%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3A%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22typ%22%3EHandleAppInstalled%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Eproperties%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E)%3B%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kwd%22%3Ebreak%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3B%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kwd%22%3Ecase%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22typ%22%3ESPRemoteEventType%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EAppUninstalling%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3A%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22typ%22%3EHandleAppUninstalling%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Eproperties%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E)%3B%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kwd%22%3Ebreak%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3B%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kwd%22%3Ecase%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22typ%22%3ESPRemoteEventType%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EItemAdded%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3A%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22typ%22%3EHandleItemAdded%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Eproperties%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E)%3B%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kwd%22%3Ebreak%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3B%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22pun%22%3E%7D%3C%2FSPAN%3E%0A%0A%0A%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kwd%22%3Ereturn%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20result%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3B%3C%2FSPAN%3E%0A%20%20%20%20%20%3CSPAN%20class%3D%22pun%22%3E%7D%3C%2FSPAN%3E%0A%20%20%20%20%20%3CSPAN%20class%3D%22com%22%3E%2F%2F%20code%20goes%20here%20for%20the%20above%20methods%20implementation%20..%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%3CSTRONG%3EFor%20debugging%20the%20RER%2C%20I%20did%20these%20steps%3A-%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E1-%3C%2FSTRONG%3E%20I%20run%20this%20ngrok%20command%3A-%3C%2FP%3E%3CPRE%3E%3CSPAN%20class%3D%22pln%22%3Engrok%20http%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E--%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Ehost%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Eheader%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Erewrite%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22lit%22%3E54001%3C%2FSPAN%3E%3CSPAN%20class%3D%22com%22%3E%2F%2F%20where%20this%20port%20is%20our%20RER%20port%20inside%20visual%20studio%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%3CSTRONG%3E2-%3C%2FSTRONG%3E%20Update%20the%20Update%20web.config%2C%20with%20the%20url%20i%20got%20from%20the%20above%20command%3A-%20%3CA%20href%3D%22https%3A%2F%2Fi.stack.imgur.com%2FqZgoQ.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fi.stack.imgur.com%2FqZgoQ.png%22%20alt%3D%22enter%20image%20description%20here%22%20border%3D%220%22%20%2F%3E%3C%2FA%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E3-%3C%2FSTRONG%3E%20Set%20the%20web%20application%20as%20Start%20Up%20project.%3C%2FP%3E%3CP%3E%3CSTRONG%3E4-%3C%2FSTRONG%3E%20Navigate%20to%20the%20ngrok%20url%20where%20i%20got%20this%20page%3A-%20%3CA%20href%3D%22https%3A%2F%2Fi.stack.imgur.com%2FqdIdQ.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fi.stack.imgur.com%2FqdIdQ.png%22%20alt%3D%22enter%20image%20description%20here%22%20border%3D%220%22%20%2F%3E%3C%2FA%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E5-%3C%2FSTRONG%3E%20Register%20the%20app%20and%20update%20the%20web.config%20with%20the%20generated%20ClientId%20%2B%20ClientSecret%20%3CA%20href%3D%22https%3A%2F%2Fi.stack.imgur.com%2Fp1zMZ.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fi.stack.imgur.com%2Fp1zMZ.png%22%20alt%3D%22enter%20image%20description%20here%22%20border%3D%220%22%20%2F%3E%3C%2FA%3E%3CA%20href%3D%22https%3A%2F%2Fi.stack.imgur.com%2F5O3ca.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fi.stack.imgur.com%2F5O3ca.png%22%20alt%3D%22enter%20image%20description%20here%22%20border%3D%220%22%20%2F%3E%3C%2FA%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E6-%3C%2FSTRONG%3E%20After%20that%20i%20run%20the%20Visual%20Studio%20project%20%26gt%3B%26gt%3B%20i%20got%20this%20message%20to%20trust%20the%20app%3A-%20%3CA%20href%3D%22https%3A%2F%2Fi.stack.imgur.com%2FbcIhD.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fi.stack.imgur.com%2FbcIhD.png%22%20alt%3D%22enter%20image%20description%20here%22%20border%3D%220%22%20%2F%3E%3C%2FA%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E7-%3C%2FSTRONG%3E%20Where%20the%20app%20start%20showing%20inside%20the%20site%20content%20page%20with%20a%20message%20that%20it%20is%20been%20added...%3C%2FP%3E%3CP%3E%3CSTRONG%3E8-%3C%2FSTRONG%3E%20After%20that%20my%20code%20reached%20this%20break%20point%3A-%20%3CA%20href%3D%22https%3A%2F%2Fi.stack.imgur.com%2F4PoEQ.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fi.stack.imgur.com%2F4PoEQ.png%22%20alt%3D%22enter%20image%20description%20here%22%20border%3D%220%22%20%2F%3E%3C%2FA%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E9-%3C%2FSTRONG%3E%20But%20inside%20the%20TokenHelper.cs%20%2C%20I%20got%20this%20exception**%3A-%3C%2FP%3E%3CPRE%3E%3CSPAN%20class%3D%22typ%22%3EAn%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20exception%20of%20type%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22str%22%3E'Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException'%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Eoccurred%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22kwd%22%3Ein%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E****%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EWeb%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Edll%20but%20was%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22kwd%22%3Enot%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20handled%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22kwd%22%3Ein%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20user%20code%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22typ%22%3EAdditional%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20information%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22str%22%3E%22localhost%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kwd%22%3Eis%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kwd%22%3Enot%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20the%20intended%20audience%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22str%22%3E%22f15f8358-54c4-4767-95b2-98051ed0b1c5%2F00af9b86.ngrok.io%408208ba41-935e-4b54-ace7-%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eon%20this%20code%3A-%20%3CA%20href%3D%22https%3A%2F%2Fi.stack.imgur.com%2FScUeS.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fi.stack.imgur.com%2FScUeS.png%22%20alt%3D%22enter%20image%20description%20here%22%20border%3D%220%22%20%2F%3E%3C%2FA%3E%3C%2FP%3E%3CP%3Eso%20can%20anyone%20advice%20on%20this%20please%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-401326%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-725156%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20debug%20my%20remote%20event%20receiver%20using%20ngrok.Error%20%22Localhost%20is%20not%20the%20intended%20a%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-725156%22%20slang%3D%22en-US%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F233354%22%20target%3D%22_blank%22%3E%40john%20john%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20starting%20a%20new%26nbsp%3B%3CSPAN%3Eprovider-hosted%20Add-in%26nbsp%3BRER%20project%20and%20I%20want%20to%20use%20Ngrok%20to%20debug.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWere%20you%20able%20to%20solve%20your%20problem%3F%26nbsp%3BI%20don't%20want%20to%20put%20to%20much%20work%20on%20a%20project%20that%20I%20won't%20be%20able%20to%20debug...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3EChris%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-727963%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20debug%20my%20remote%20event%20receiver%20using%20ngrok.Error%20%22Localhost%20is%20not%20the%20intended%20a%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-727963%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CBLOCKQUOTE%3E%3CHR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F349642%22%20target%3D%22_blank%22%3E%40Chris600%3C%2FA%3E%26nbsp%3Bwrote%3A%3CBR%20%2F%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F233354%22%20target%3D%22_blank%22%3E%40john%20john%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20starting%20a%20new%26nbsp%3B%3CSPAN%3Eprovider-hosted%20Add-in%26nbsp%3BRER%20project%20and%20I%20want%20to%20use%20Ngrok%20to%20debug.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWere%20you%20able%20to%20solve%20your%20problem%3F%26nbsp%3BI%20don't%20want%20to%20put%20to%20much%20work%20on%20a%20project%20that%20I%20won't%20be%20able%20to%20debug...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3EChris%3C%2FP%3E%3CHR%20%2F%3E%3C%2FBLOCKQUOTE%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F349642%22%20target%3D%22_blank%22%3E%40Chris600%3C%2FA%3Ei%20have%20not%20used%20Ngrok%20before%2C%20so%20i%20can%20not%20tell%20if%20you%20will%20be%20able%20to%20debug%20your%20RER%20using%20it%20or%20not....%20but%20still%20i%20can%20not%20debug%20my%20RER%20using%20azure%20service%20bus%20(which%20suppose%20to%20work%20well%2C%20even%20VS%20have%20a%20place%20to%20define%20the%20service%20bus%20url%20!!!)%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Super Contributor

I want to debug our remote event receiver for a sharepoint online site collection. and since the azure service bus appraoch for debugging RER is not supported anymore. so i am trying to use the ngrok appraoch. I did these steps:-

 

1- Inside Visual Studio 2015 >> create new sharepoint add-in >> type provider-hosted Add-in >> I enter the url for a test enterprise wiki site collection which have the Sideloading of apps feature enabled. enter image description here

 

2- Then i enabled the handle Add-in installed/uninstalled:- enter image description here

3- Then inside the AppEventReceiver.svc i entered code this code + the methods implementation:-

public SPRemoteEventResult ProcessEvent(SPRemoteEventProperties properties)
         {
             SPRemoteEventResult result = new SPRemoteEventResult();

         switch (properties.EventType)
         {
             case SPRemoteEventType.AppInstalled:
                 HandleAppInstalled(properties);
                 break;
             case SPRemoteEventType.AppUninstalling:
                HandleAppUninstalling(properties);
                 break;
             case SPRemoteEventType.ItemAdded:
                 HandleItemAdded(properties);
                 break;
         }


         return result;
     }
     // code goes here for the above methods implementation ..

For debugging the RER, I did these steps:-

1- I run this ngrok command:-

ngrok http --host-header=rewrite 54001// where this port is our RER port inside visual studio

2- Update the Update web.config, with the url i got from the above command:- enter image description here

3- Set the web application as Start Up project.

4- Navigate to the ngrok url where i got this page:- enter image description here

5- Register the app and update the web.config with the generated ClientId + ClientSecret enter image description hereenter image description here

6- After that i run the Visual Studio project >> i got this message to trust the app:- enter image description here

7- Where the app start showing inside the site content page with a message that it is been added...

8- After that my code reached this break point:- enter image description here

9- But inside the TokenHelper.cs , I got this exception**:-

An exception of type 'Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException'occurred in ****Web.dll but was not handled in user code Additional information: "localhost" is not the intended audience "f15f8358-54c4-4767-95b2-98051ed0b1c5/00af9b86.ngrok.io@8208ba41-935e-4b54-ace7-

 

on this code:- enter image description here

so can anyone advice on this please?

2 Replies
Highlighted

Hello @john john,

 

I'm starting a new provider-hosted Add-in RER project and I want to use Ngrok to debug.

 

Were you able to solve your problem? I don't want to put to much work on a project that I won't be able to debug...

 

Thanks,

Chris

Highlighted

 


@Chris600 wrote:

Hello @john john,

 

I'm starting a new provider-hosted Add-in RER project and I want to use Ngrok to debug.

 

Were you able to solve your problem? I don't want to put to much work on a project that I won't be able to debug...

 

Thanks,

Chris


@Chris600i have not used Ngrok before, so i can not tell if you will be able to debug your RER using it or not.... but still i can not debug my RER using azure service bus (which suppose to work well, even VS have a place to define the service bus url !!!)