Home > Forum > Plugins > SDK: Using existing connections

SDK: Using existing connections
0

MVP

Hi everyone,

did anyone reuse an existing connection a plugin using the ConfigEditableConnectionID attribute?

When I searched for the attribute name I only found references to the automatically generated documentation.

In my case I wanted to reuse a REST connection or more specific, the authentication.

Best regards,
Daniel

Hi,
Do you mean using credentials from defined REST connection?
Based on parameters from connection it's necessary to create own REST client in SDK code.

//Config
[ConfigEditableConnectionID(DisplayName = "REST Token Service", ConnectionsType = DataConnectionType.WebServiceREST)]
public int ValTokenConnID { get; set; }

//Action
var restConn = new ConnectionsHelper(ctx).GetConnectionToWebService(new GetByConnectionParams(Configuration.ValTokenConnID));
// restConn.Url
// restConn.ClientID
// restConn.ClientSecret