# OAuth2 Token Type Detector
# Captures the token_type field to verify Bearer authentication
# Example: {"access_token": "...", "token_type": "Bearer"}
#
# This helps validate that the token should be used with Bearer authentication
#
# Created: December 2024
# Author: Web Performance Inc

# Detector type: Sticky Regular Expression Assignment Detector

# Descriptive name
detector.name=OAuth2 Token Type (JSON)

# Pattern to capture token_type value
# Usually "Bearer" but could be other types in custom implementations
search.pattern="token_type"\\s*:\\s*"([^"]+)"

# JSON responses only
content_type.pattern=(?i).*json.*|.*javascript.*|.*html.*

# Single capture group
groups.count=1

# Make it sticky for validation
group1.sticky=true

# Metadata family
equivalency.name.family=OAuth2-Metadata

# JSON unescaping
unescape.source=Only Javascript

# Enable detector
detector=sread

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