Skip to content

curityio/opentelemetry-phantom-token

Repository files navigation

OpenTelemetry OAuth End-to-End Tracing

Quality Availability

An example end-to-end deployment for a phantom token flow that uses OpenTelemetry tracing.

Phantom Token Flow

The example uses a client that calls an API in a phantom token flow:

phantom token flow

During an API request, each component generates OpenTelemetry spans within an overall trace.
You can view all traces within an observability tool, for a trace ID that the client generates.

trace-overview

When required, OpenTelemetry provides visibility of subrequests, to simplify investigation of technical issues.

trace-details

Prerequisites

First copy a license file for the Curity Identity Server into the idsvr folder.
Also ensure that your local computer has the following tools.

  • A Docker engine
  • Node.js 20 or later.
  • OpenSSL 3 or later.

Components

Component Location Description
Client A shell client that sends OAuth and API requests with a traceparent header.
API Gateway The Kong API gateway adds a span to the trace for all API gateway requests.
API http://api.example.com An example Node.js API that adds a span to the trace using the OpenTelemetry SDK.
Curity Identity Server http://login.example.com The Curity Identity Server adds a span to the trace for all OAuth requests.
OpenTelemetry Collector The OpenTelemetry collector receives and distributes trace data within the backend platform.
Zipkin http://traces.example.com The tracing frontend visualizes the end-to-end trace data.

Deploy the Backend

First add these entries to the local computer's /etc/hosts file:

127.0.0.1 api.example.com login.example.com traces.example.com

Then run the following commands to deploy all backend components within a Docker Compose network.

./build.sh
./run.sh

Run the Client

Wait 30 seconds or so, to ensure that all backend components are up.
Then run a console client that initiates OAuth and API requests.

./democlient/run.sh

Further Information

About

An example OAuth flow that uses the Curity Identity Server's OpenTelemetry support

Resources

License

Stars

0 stars

Watchers

2 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors