oidc_tokenOIDC

Mock Jutsu HOW-TO | EN

The oidc_token function within the mock-jutsu library is a specialized tool designed for developers and QA engineers who need to simulate OpenID Connect authentication flows without the complexity of managing a live Identity Provider. This function generates a JSON Web Token (JWT) that adheres to the OpenID Connect standard, providing a realistic payload for testing authorization layers and identity-aware applications. Each generated oidc_token includes the standard set of claims required for validation, including the issuer (iss), subject (sub), audience (aud), expiration time (exp), issued at (iat), and a unique JWT ID (jti). By producing high-fidelity mock data, mock-jutsu ensures that your security middleware can be rigorously tested against properly formatted identity assertions.

One of the standout features of this function is its use of the HS256 (HMAC with SHA-256) algorithm for symmetric signing. This approach offers a significant performance advantage over asymmetric signing methods because it does not require the generation or management of complex RSA or EC key pairs. For developers, this means the oidc_token can be generated and validated instantly during local development or within continuous integration pipelines. This fast symmetric signing makes it an excellent choice for creating test data that mimics the structure of production tokens while maintaining the speed necessary for rapid unit testing and iterative debugging cycles.

The mock-jutsu library provides multiple entry points for generating an oidc_token, ensuring it fits into any technical stack. For quick prototyping or shell scripting, the CLI command "mockjutsu generate oidc_token" provides immediate results. Python developers can programmatically generate tokens within their test suites using the simple "jutsu.generate('oidc_token')" syntax. Additionally, for performance and load testing, the library supports JMeter integration via the "${__mockjutsu(oidc_token,)}" function. This versatility allows teams to maintain consistent identity mock data across different stages of the software development lifecycle, from initial coding to high-concurrency stress testing.

Ultimately, the oidc_token function empowers development teams to build more robust applications by removing the dependencies usually associated with authentication testing. By utilizing mock-jutsu to automate the creation of standards-compliant tokens, you can focus on perfecting your application's logic rather than troubleshooting infrastructure. Whether you are validating a new API gateway, testing frontend user profile rendering, or verifying token expiration handling, this function provides the reliable, predictable test data required to ensure your security implementation is production-ready.

CLI Usage
mockjutsu generate oidc_tokenmockjutsu bulk oidc_token --count 10mockjutsu export oidc_token --count 10 --format jsonmockjutsu export oidc_token --count 10 --format csvmockjutsu export oidc_token --count 10 --format sql# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate oidc_token --maskmockjutsu bulk oidc_token --count 5 --mask
Python API
from mockjutsu import jutsujutsu.generate('oidc_token')jutsu.bulk('oidc_token', count=10)jutsu.template(['oidc_token'], count=5)# mask=True: regulation-compliant outputjutsu.generate('oidc_token', mask=True)jutsu.bulk('oidc_token', count=5, mask=True)
JMeter
${__mockjutsu_oidc(oidc_token)}# JMeter Function: __mockjutsu_oidc# Parameter 1: oidc_token# Parameter 2: (not required for this function)# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_oidc(oidc_token,mask)}
REST API
GET /generate/oidc_token# → {"type":"oidc_token","result":"...","status":"ok"}GET /bulk/oidc_token?count=10POST /template {"types":["oidc_token"],"count":1}# mask=true: regulation-compliant outputGET /generate/oidc_token?mask=trueGET /bulk/oidc_token?count=5&mask=true

Parameters

Parameter Values Description
--mask true | false Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…)

Other Languages