๐Ÿ”งJAR Complete Implementation Guide

๐Ÿ“– Getting started? Check the Integration Flow Overview to understand the complete integration process.

IMPORTANT: JAR for Confidential Clients Only

Oten Identity Provider requires JAR (JWT-Secured Authorization Request) for CONFIDENTIAL CLIENTS only. Public clients (SPAs/Mobile) must use PKCE instead.

Client Type Requirements:

Supported JAR Algorithms

Oten IDP supports exactly two algorithms:

Algorithm
Key Type
Security Level
Recommended For

HS256

Symmetric (client_secret)

Good

Development, Internal Apps

EdDSA

Asymmetric (Ed25519 key pair)

Better

Production, Public Apps

JAR Structure

Every JAR must include these JWT claims:

Required JWT Claims

Optional Claims

Method 1: HS256 Implementation (Simpler)

When to Use HS256

  • โœ… Development and testing

  • โœ… Internal applications

  • โœ… When you want simple setup

  • โŒ Not recommended for public applications

Complete HS256 Example

JavaScript/Node.js

Python

Go

๐Ÿ” Method 2: EdDSA Implementation (More Secure)

When to Use EdDSA

  • โœ… Production applications

  • โœ… Public applications

  • โœ… When you need maximum security

  • โœ… When you want to follow best practices

Step 1: Generate Ed25519 Key Pair

Using OpenSSL

Using Node.js

Step 2: Register Public Key with Oten

You have two options to register your public key:

Option A: Through Developer Portal

  1. Login to https://developer.oten.com (Coming Soon)

  2. Navigate to your application settings

  3. Upload your public key file (jar-public-key.pem)

  4. Note the Key ID assigned by the system

Option B: Through Support Request

  1. Email your public key to [email protected]

  2. Include your client_id and application name

  3. Wait for confirmation and Key ID

Step 3: Complete EdDSA Implementation

JavaScript/Node.js

Python

Go

๐Ÿšจ Common Errors and Solutions

Error: "invalid_request" (Missing request parameter)

Cause: Missing request parameter in authorization URL Solution: Always include JAR in request parameter

Error: "invalid_request_object" (Invalid JAR signature)

Cause:

  • Wrong signing algorithm (must be HS256 or EdDSA)

  • Wrong private key or client secret

  • Missing or incorrect kid in JWT header (for EdDSA)

Solution:

  • Verify algorithm is HS256 or EdDSA

  • Check private key matches registered public key

  • Ensure kid matches registered Key ID

Error: "invalid_request" (JAR expired)

Cause: JAR exp claim is too old Solution: Set exp to current time + 5 minutes maximum

Error: "invalid_request" (Invalid audience)

Cause: Wrong aud claim in JAR Solution: Use exact audience: https://account.oten.com

Error: "invalid_request" (Invalid issuer)

Cause: iss claim doesn't match client_id Solution: Set iss to your exact client_id

JAR Validation Checklist

Before testing with Oten IDP:

For HS256:

For EdDSA:

Testing Your JAR Implementation

Test JAR Structure

Test with curl



Remember: JAR is required for confidential clients only. Public clients must use PKCE instead.

Need Help with JAR Implementation?

If your application cannot implement JAR due to technical constraints, please contact our support team to discuss enabling traditional OAuth flow as a temporary solution:

๐Ÿ“ง Contact Support: [email protected]envelope

Include in your request:

  • Application details and technical constraints

  • Reason why JAR cannot be implemented

  • Security measures you have in place

  • Timeline for potential JAR migration

Security Notice: Traditional OAuth flow has lower security compared to JAR and should only be used temporarily while planning JAR implementation.

Last updated