ETA and EMA(both C/C++ and Java) have NIProvider and Consumer examples for TREP Authentication.
On the ETA side, the standard Consumer and NIProvider applications show base ETA usage of the functionality. The VAConsumer, VANIProvider, and WatchlistConsumer examples show Trep Auth usage with the ETA Value Added components and Reactor Watchlist.
For EMA, Example 430 for both Consumer and NIProvider shows TREP Auth usage.
All of the above applies to both C/C++ and Java APIs.
Note that all of these examples are intended to showcase API usage. These do not show token generation or retrieval, as it is expected that these will be specific to client deployments.