Skip to content

Instantly share code, notes, and snippets.

@zahedshareef
Last active May 23, 2021 12:07
Show Gist options
  • Save zahedshareef/a550cccb38dfcdaf82d14e94a636ed91 to your computer and use it in GitHub Desktop.
Save zahedshareef/a550cccb38dfcdaf82d14e94a636ed91 to your computer and use it in GitHub Desktop.

Setting up the agent SDK:


var agent = new Builder()
	.SetEnvironment(environment)
	.SetSandbox(init.Sandbox)
	.SetService(init.ServiceName)
	.SetServiceProvider(init.ServiceProviderName)
	.Build();

Decrypt the encrypted payload:


var decryptPayload = agent.SecurityManager.DecryptPayload<dynamic>(payload);

Decrypt redirect token:


//the token-type can be admin or operation
var decryptToken = agent.SecurityManager.DecryptRedirectToken(token, "admin");

Send Service Metering Events:


var result = await agent.eventPublisher.Send("ServiceProvider-Services", payload);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment