Sample Code

This document provides complete, working code examples for integrating with Oten IDP across multiple programming languages.

Prerequisites

Before using these examples:

  1. Register your application with Oten IDP

  2. Obtain your client_id and client_secret (if applicable)

  3. Set up your redirect URI

  4. Choose your JAR signing method (HS256 or EdDSA)

Environment Variables

All examples use these environment variables:

# Required for all examples
OTEN_CLIENT_ID=your_client_id
OTEN_REDIRECT_URI=https://yourapp.com/callback

# For HS256 signing
OTEN_CLIENT_SECRET=your_client_secret

# For EdDSA signing
OTEN_PRIVATE_KEY_PATH=./jar-private-key.pem
OTEN_KEY_ID=your-key-id

# Environment
OTEN_ENV=production  # or development

🌐 JavaScript/Node.js

Complete Integration Example

🐍 Python

Complete Integration Example

🐹 Go

Complete Integration Example

Last updated