static authentication for custom service broker

  • 19 March 2021
  • 1 reply
  • 8 views

Hi,

I have created a Custom Service Broker using Visual Studio and registered the .dll. I want to create a Service Instance with static credentials since the broker should run with a specific username and password. I created the Service Instance by choosing Mode as Static and gave username and password(its in metnet domain). I created an SMO and executed. It does not work. 

Any solution for this scenario?


1 reply

Userlevel 3
Badge +10
In your code, are you retrieving the username and password and passing them along to your service as per:
https://help.nintex.com/en-US/k2five/devref/5.4/default.htm#Extend/SmO/Authentication.htm

Static
Static credentials allow you to configure a specific username, password and optional "Extra Data" that will be used to connect to the underlying provider. This approach is useful when the underlying Provider uses some other authentication mechanism and you can use a static username and password to connect to the provider.

In your Service Broker code you would retrieve the settings for the username and password and then connect to the Provider with these values. Note that this approach is used when it is not necessary to secure the data based on the connected user, because all calls to the provider will be performed in the context of the Static user account, not the context of the connected user.

When using Static credentials you can retrieve the configured username and password by accessing the following properties:

string username = base.Service.ServiceConfiguration.ServiceAuthentication.UserName;
string password = base.Service.ServiceConfiguration.ServiceAuthentication.Password;

Reply