Kogoshvili.Temporal.CodecServer 1.0.3

dotnet add package Kogoshvili.Temporal.CodecServer --version 1.0.3
                    
NuGet\Install-Package Kogoshvili.Temporal.CodecServer -Version 1.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Kogoshvili.Temporal.CodecServer" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Kogoshvili.Temporal.CodecServer" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="Kogoshvili.Temporal.CodecServer" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Kogoshvili.Temporal.CodecServer --version 1.0.3
                    
#r "nuget: Kogoshvili.Temporal.CodecServer, 1.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Kogoshvili.Temporal.CodecServer@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Kogoshvili.Temporal.CodecServer&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=Kogoshvili.Temporal.CodecServer&version=1.0.3
                    
Install as a Cake Tool

Kogoshvili.Temporal.CodecServer

A ready-made HTTP codec server for the Temporal .NET SDK. It exposes the /encode and /decode endpoints the Temporal Web UI and CLI use to encode and decode workflow payloads, wrapping the same IPayloadCodec your workers use — so encryption keys never leave your environment and the UI can still display decoded data.

It is an ASP.NET Core library: call AddTemporalCodecServer() / MapTemporalCodecServer() from any WebApplication (including the same app that hosts your workers via Kogoshvili.Temporal.Hosting).

Minimal setup

Register the IPayloadCodec your workers already use, then add and map the codec server. No configuration is required — CORS and no-auth defaults apply.

using Kogoshvili.Temporal.Codec;
using Kogoshvili.Temporal.CodecServer;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddSingleton<IPayloadCodec>(
    new EncryptionCodec("test-key-test-key-test-key-test!"));

builder.Services.AddTemporalCodecServer();

var app = builder.Build();

app.UseCors();            // enables the codec-server CORS policy (for the Web UI)
app.UseAuthentication();
app.UseAuthorization();

app.MapTemporalCodecServer();

app.Run();

The endpoints accept the Temporal Payloads protobuf-as-JSON envelope and follow the codec server protocol: POST /encode and POST /decode, plus POST /{namespace}/encode / POST /{namespace}/decode for namespace-scoped deployments. The X-Namespace header is accepted (and permitted by CORS) but not consumed by the codec.

Configuration

AddTemporalCodecServer takes an options delegate for CORS and authentication.

builder.Services.AddTemporalCodecServer(o =>
{
    o.AllowedOrigins = new[] { "https://my.ui.example.com" };
    o.AllowCredentials = true;
});

CORS defaults to the Temporal Cloud UI plus the common local dev servers, with X-Namespace, Content-Type, and Authorization headers allowed:

// Defaults
o.AllowedOrigins = new[]
{
    "https://cloud.temporal.io",
    "http://localhost:8080",
    "http://localhost:8233",
};
o.AllowCredentials = true;   // required for the cross-origin-credentials auth mode

AllowedOrigins must be an explicit list (no wildcard) when AllowCredentials is true. The same options can instead be passed to MapTemporalCodecServer(options), which wins over any configured options.

Enable authentication with a single flag plus the relevant OIDC settings:

builder.Services.AddTemporalCodecServer(o =>
{
    o.Auth.PassAccessToken = true;                    // validate the UI's JWT
    // o.Auth.IncludeCrossOriginCredentials = true;   // or your own login flow
});

Full configuration

Two auth modes, matching the Temporal Web UI's codec-server options.

Pass access token (Auth.PassAccessToken = true) validates the JWT the UI forwards in the Authorization header against the OIDC provider's JWKS. It defaults to Temporal Cloud, so no Authority/Audience are needed for Cloud.

builder.Services.AddTemporalCodecServer(o =>
{
    o.Auth.PassAccessToken = true;
    o.Auth.Authority = "https://login.tmprl.cloud";          // default
    o.Auth.Audience = "https://saas-api.tmprl.cloud";        // default
    o.Auth.RequireHttpsMetadata = true;                      // default; set false for localhost HTTP
});

Include cross-origin credentials (Auth.IncludeCrossOriginCredentials = true) gives the codec server its own session via an OAuth2 authorization-code flow. Opening the Temporal UI redirects through your IdP and back; login and logout routes are mapped at LoginPath (/codec/login) and LogoutPath (/codec/logout). Requires AllowCredentials = true (the default) and a ClientId/ClientSecret registered with your IdP.

builder.Services.AddTemporalCodecServer(o =>
{
    o.Auth.IncludeCrossOriginCredentials = true;
    o.Auth.OidcAuthority = "https://login.example.com";
    o.Auth.ClientId = "my-codec-server";
    o.Auth.ClientSecret = "...";

    o.AllowCredentials = true;
    o.LoginPath = "/codec/login";    // default
    o.LogoutPath = "/codec/logout";  // default
});

The two modes can be combined; when both are set, either an accepted JWT or a valid session cookie satisfies the endpoint's authorization policy.

Security notes:

  • The codec server can decode sensitive data, so run it over HTTPS (RequireHttpsMetadata = true is the default) and restrict ingress (VPN or localhost) unless you have enabled authentication.
  • In the cross-origin-credentials mode, the session cookie is sent with HttpOnly, SameSite=None, and Secure=Always, and expires after 8 hours.

Not affiliated with or endorsed by Temporal Technologies.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3 91 9/4/2026
1.0.2 94 9/3/2026
1.0.1 91 9/1/2026
1.0.0 100 8/31/2026
1.0.0-beta.10 66 8/28/2026
1.0.0-beta.9 61 8/28/2026

Ready-made codec server for the Temporal Web UI/CLI: /encode and /decode endpoints with JWT-bearer and OAuth2 authorization-code auth.