Skip to content

SuperOffice/SuperOffice.DevNet.Online.SystemUser.NetCore.Console

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SuperOffice.DevNet.Online.SystemUser.NetCore.Console

Application that demonstrates how to use .NET Core (2.2) and exchange a SuperOffice Online system user token for a system user ticket.

Switching Between Envionments

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:

  1. ServiceConsoleCert.xml (Contains your applications PRIVATE key)
  2. SuperOfficeFederatedLogin.crt (Is the PUBLIC SuperOffice certificate)

Getting Started From Scratch

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.

AddService

In the Connected Services pane, click the Microsoft WCF Web Services Reference Provider option.

Connected Services

In the Configure WCF Web Service Reference pain, click Browse, then locate and select the PartnerSystemUserService.wsdl file.

WSDL Select

When the service definition has finished loading, expand the available Services and click the IPartnerSystemUserService interface, then click Finish.

Generate Code

Observe the generated code based on the WSDL definition.

Generate Code

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.

About

.NET Core (2.2) console application that demonstrates how to exchange system user token for a system user ticket.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages