Application that demonstrates how to use .NET Core (2.2) and exchange a SuperOffice Online system user token for a system user ticket.
Remember that some settings must be changed between the environments: SOD, STAGE and PRODUCTION!
All code dependencies reside in the Constants class...
public static class Constants
{
/**************************************************************************
*** When migrating between SOD, STAGE and PRODUCTION **********************
*** 1) Change ServiceConsoleCert.xml and SuperOfficeFederatedLogin.cert ***
*** 2) Change the following constant values *******************************
************||||||||||||||||||||||||||||||||||||||||||||||||||*************
************\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/************/
// set the environment system user endpoint (sod, stage, online)
public const string SystemUserEndpoint = "https://sod.superoffice.com/Login/services/PartnerSystemUserService.svc";
// App Secret / Token
public const string ApplicationToken = "YOUR_APPLICATION_TOKEN";
// Application System User Token
public const string SystemUserToken = "YOUR_APPLICATION_NAME-SomeRandomCode";
// Customer ContextIdentifier
public const string ContextIdentifier = "YOUR_TENANT_CONTEXT_IDENTIFIER";
/*****^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*******
******||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*******
****** Change these values between SOD, Stage and Production **************
**************************************************************************/
}
Also, update the following two files:
- ServiceConsoleCert.xml (Contains your applications PRIVATE key)
- SuperOfficeFederatedLogin.crt (Is the PUBLIC SuperOffice certificate)
This has already been done in the example source code, but if you want to start from scratch, this is how I did it.
Create a .net core console application. Right-click project and in the Add menu, click Connected Service.
In the Connected Services pane, click the Microsoft WCF Web Services Reference Provider option.
In the Configure WCF Web Service Reference pain, click Browse, then locate and select the PartnerSystemUserService.wsdl file.
When the service definition has finished loading, expand the available Services and click the IPartnerSystemUserService interface, then click Finish.
Observe the generated code based on the WSDL definition.
Review the code in the project to see how to call this SOAP service and exchange a system user token for a system user ticket.