# OAuth2 Error Detection
# Detects OAuth2 error responses that trigger token refresh
# Examples: 
# {"error": "invalid_token", "error_description": "The access token expired"}
# WWW-Authenticate: Bearer realm="api", error="invalid_token"
#
# This helps ASM know when to trigger refresh flow
#
# Created: December 2024
# Author: Web Performance Inc

detector.name=OAuth2 Token Error

# Detect common OAuth2 error patterns
# These indicate token needs refresh
search.pattern=(?:"error"\\s*:\\s*"(?:invalid_token|token_expired|expired_token)"|error="invalid_token")

# Only JSON responses where OAuth2 errors actually occur
content_type.pattern=application/json|text/json|.*json.*

groups.count=0

# This is a trigger detector, not extraction
equivalency.name.family=OAuth2-Errors

detector=sread

# Platform detection metadata
platform=oauth2
detection.hint=JSON with "access_token", "refresh_token", "token_type", or "Bearer" authorization
