Portal Community

IBusinessServiceAuthProvider

public interface IBusinessServiceAuthProvider
{
    Task<Dictionary<string, string>> GetAuthHeadersAsync(
        string serviceId,
        CancellationToken cancellationToken = default);
}

public enum AuthType
{
    None,
    ApiKey,
    BearerToken,
    MutualTLS,
    TokenPassThrough   // passes the calling actor's token
}

Auth Type Behaviors

AuthTypeHeader AddedCredential Source
ApiKeyX-Api-Key: {key}ICredentialResolver by service credentialId
BearerTokenAuthorization: Bearer {token}Service account token from ICredentialResolver
MutualTLSTLS client certificate on the HttpClientCertificate from certificate store
TokenPassThroughAuthorization: Bearer {actor-token}Current execution actor's access token

Token Pass-Through Pattern

When AuthType = TokenPassThrough, the service receives the same bearer token that the workflow execution actor used to authenticate. This means the service enforces its own RBAC against the actor's permissions — not the workflow's service account. Use this pattern when the service should apply user-specific access control:

public class TokenPassThroughAuthProvider : IBusinessServiceAuthProvider
{
    private readonly IHttpContextAccessor _httpContextAccessor;

    public Task<Dictionary<string, string>> GetAuthHeadersAsync(string serviceId, ...)
    {
        var token = _httpContextAccessor.HttpContext?.Request.Headers["Authorization"].ToString()
            ?? throw new InvalidOperationException("No actor token in context");

        return Task.FromResult(new Dictionary<string, string>
        {
            ["Authorization"] = token
        });
    }
}
Never store tokens in node config. Auth is always injected by IBusinessServiceAuthProvider from secure credential storage. Workflow designers cannot see or modify auth credentials — they only specify which service and operation to call.