This article shows how to setup a new project with DS Server and how to use the document editor NuGet package in an ASP.NET Core MVC web application.
DS Server Setup
In the DS Server admin portal, a new security profile needs to be added.
Select Security Profiles from the main menu to open the security profile overview. Click on Create new profile to create a new security profile:
Type in a name and confirm with Create:
The profile details are shown including the Client ID and Client Secret values required for the OAuth authentication flow:
ASP.NET Core MVC Web Application
In the next step, a new ASP.NET Core MVC Web Appplication is created in Visual Studio 2019.
In Visual Studio 2019, create a new ASP.NET Core Web Application, choose a name and confirm with Create.
In the next dialog, choose Web Application (Model-View-Controller) and confirm with Create:
Select Manage NuGet Packages for Solution... from the NuGet Package Manager menu entry in the Tools main menu. Search for the package TXTextControl.DocumentServices.DocumentEditor and confirm with Install.
Open the Index.cshtml in the Views -> Home folder and replace the content with the following code:
The ServiceUrl property should point to your on-premise DS Server installation.
Compile and start the application. You should see the following error, because the required "authorized redirect URI" has not been specified in the security profile:
Copy the URL from the location bar (https://localhost:44374) into the clipboard or note it.
Back in the DS Server admin portal, open the created security profile and click Add URI. Paste the URL followed by the string /textcontrol/documenteditor/auth/callback. Add the following complete string to the "Authorized Redirect URI" text box:
Confirm this step by clicking Save.
Restart the Visual Studio project or refresh the browser:
Stay tuned for further details about the new product DS Server!