sharepoint online – Installing a remote event sink add-in – System.IdentityModel.Tokens.SecurityTokenException

I am working with a remote event receiver add-in in SharePoint Online and when I try to install the add-on at the point of interruption in the HandleAppInstalled (); is activated, but when you try to use ClientContext to call the installation method, an exception occurs and the add-in can not be installed.

enter the description of the image here

The exception as follows:

enter the description of the image here

The plugin is hosted as a web application in Azure, and I'm using Cloud Explorer to debug it. It is assumed that the RER is installed in the "Site Pages" library and is activated when a file is Registered in.

I tried:

  • Register the add-on with the new customer ID and secret, in the catalog and update the values ​​in the project.
  • The framework from v4.6 to v4.7 was updated.
  • Supplement events complement Complement uninstalled and installed in True (in properties)
  • The project is established in the hosted provider and the plug-in is connected to the correct web project.
  • Probably more things that I can not think now haha

enter the description of the image here

I appreciate any help or suggestion I can get!