Skip to content

Commit ff97ec0

Browse files
author
Lasim
committed
feat(backend): add OAuth2 UserInfo endpoint for user information retrieval
1 parent 1f29a50 commit ff97ec0

File tree

2 files changed

+315
-0
lines changed

2 files changed

+315
-0
lines changed

services/backend/api-spec.json

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19122,6 +19122,191 @@
1912219122
}
1912319123
}
1912419124
},
19125+
"/api/oauth2/userinfo": {
19126+
"get": {
19127+
"summary": "Get user information",
19128+
"tags": [
19129+
"OAuth2"
19130+
],
19131+
"description": "Returns user information for the authenticated user. This is the standard OAuth2/OpenID Connect UserInfo endpoint. Requires a valid OAuth2 access token with user:read scope.",
19132+
"security": [
19133+
{
19134+
"bearerAuth": []
19135+
}
19136+
],
19137+
"responses": {
19138+
"200": {
19139+
"description": "Default Response",
19140+
"content": {
19141+
"application/json": {
19142+
"schema": {
19143+
"schema": {
19144+
"description": "User information retrieved successfully",
19145+
"type": "object",
19146+
"properties": {
19147+
"sub": {
19148+
"description": "Subject identifier - unique user ID",
19149+
"type": "string"
19150+
},
19151+
"email": {
19152+
"description": "User email address",
19153+
"type": "string",
19154+
"format": "email",
19155+
"pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
19156+
},
19157+
"name": {
19158+
"description": "Full name of the user",
19159+
"type": "string"
19160+
},
19161+
"preferred_username": {
19162+
"description": "Preferred username",
19163+
"type": "string"
19164+
},
19165+
"email_verified": {
19166+
"description": "Whether the email address has been verified",
19167+
"type": "boolean"
19168+
},
19169+
"given_name": {
19170+
"description": "Given name (first name)",
19171+
"type": "string"
19172+
},
19173+
"family_name": {
19174+
"description": "Family name (last name)",
19175+
"type": "string"
19176+
}
19177+
},
19178+
"required": [
19179+
"sub",
19180+
"email",
19181+
"preferred_username",
19182+
"email_verified"
19183+
],
19184+
"additionalProperties": false
19185+
},
19186+
"components": {}
19187+
}
19188+
}
19189+
}
19190+
},
19191+
"401": {
19192+
"description": "Default Response",
19193+
"content": {
19194+
"application/json": {
19195+
"schema": {
19196+
"schema": {
19197+
"description": "Unauthorized - Invalid or missing access token",
19198+
"type": "object",
19199+
"properties": {
19200+
"error": {
19201+
"description": "OAuth2 error code",
19202+
"type": "string"
19203+
},
19204+
"error_description": {
19205+
"description": "Human-readable error description",
19206+
"type": "string"
19207+
}
19208+
},
19209+
"required": [
19210+
"error",
19211+
"error_description"
19212+
],
19213+
"additionalProperties": false
19214+
},
19215+
"components": {}
19216+
}
19217+
}
19218+
}
19219+
},
19220+
"403": {
19221+
"description": "Default Response",
19222+
"content": {
19223+
"application/json": {
19224+
"schema": {
19225+
"schema": {
19226+
"description": "Forbidden - Insufficient scope",
19227+
"type": "object",
19228+
"properties": {
19229+
"error": {
19230+
"description": "OAuth2 error code",
19231+
"type": "string"
19232+
},
19233+
"error_description": {
19234+
"description": "Human-readable error description",
19235+
"type": "string"
19236+
}
19237+
},
19238+
"required": [
19239+
"error",
19240+
"error_description"
19241+
],
19242+
"additionalProperties": false
19243+
},
19244+
"components": {}
19245+
}
19246+
}
19247+
}
19248+
},
19249+
"404": {
19250+
"description": "Default Response",
19251+
"content": {
19252+
"application/json": {
19253+
"schema": {
19254+
"schema": {
19255+
"description": "Not Found - User not found",
19256+
"type": "object",
19257+
"properties": {
19258+
"error": {
19259+
"description": "OAuth2 error code",
19260+
"type": "string"
19261+
},
19262+
"error_description": {
19263+
"description": "Human-readable error description",
19264+
"type": "string"
19265+
}
19266+
},
19267+
"required": [
19268+
"error",
19269+
"error_description"
19270+
],
19271+
"additionalProperties": false
19272+
},
19273+
"components": {}
19274+
}
19275+
}
19276+
}
19277+
},
19278+
"500": {
19279+
"description": "Default Response",
19280+
"content": {
19281+
"application/json": {
19282+
"schema": {
19283+
"schema": {
19284+
"description": "Internal Server Error",
19285+
"type": "object",
19286+
"properties": {
19287+
"error": {
19288+
"description": "OAuth2 error code",
19289+
"type": "string"
19290+
},
19291+
"error_description": {
19292+
"description": "Human-readable error description",
19293+
"type": "string"
19294+
}
19295+
},
19296+
"required": [
19297+
"error",
19298+
"error_description"
19299+
],
19300+
"additionalProperties": false
19301+
},
19302+
"components": {}
19303+
}
19304+
}
19305+
}
19306+
}
19307+
}
19308+
}
19309+
},
1912519310
"/api/auth/email/register": {
1912619311
"post": {
1912719312
"summary": "User registration via email",

services/backend/api-spec.yaml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12887,6 +12887,136 @@ paths:
1288712887
- error_description
1288812888
additionalProperties: false
1288912889
components: {}
12890+
/api/oauth2/userinfo:
12891+
get:
12892+
summary: Get user information
12893+
tags:
12894+
- OAuth2
12895+
description: Returns user information for the authenticated user. This is the
12896+
standard OAuth2/OpenID Connect UserInfo endpoint. Requires a valid
12897+
OAuth2 access token with user:read scope.
12898+
security:
12899+
- bearerAuth: []
12900+
responses:
12901+
"200":
12902+
description: Default Response
12903+
content:
12904+
application/json:
12905+
schema:
12906+
schema:
12907+
description: User information retrieved successfully
12908+
type: object
12909+
properties:
12910+
sub:
12911+
description: Subject identifier - unique user ID
12912+
type: string
12913+
email:
12914+
description: User email address
12915+
type: string
12916+
format: email
12917+
pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
12918+
name:
12919+
description: Full name of the user
12920+
type: string
12921+
preferred_username:
12922+
description: Preferred username
12923+
type: string
12924+
email_verified:
12925+
description: Whether the email address has been verified
12926+
type: boolean
12927+
given_name:
12928+
description: Given name (first name)
12929+
type: string
12930+
family_name:
12931+
description: Family name (last name)
12932+
type: string
12933+
required:
12934+
- sub
12935+
- email
12936+
- preferred_username
12937+
- email_verified
12938+
additionalProperties: false
12939+
components: {}
12940+
"401":
12941+
description: Default Response
12942+
content:
12943+
application/json:
12944+
schema:
12945+
schema:
12946+
description: Unauthorized - Invalid or missing access token
12947+
type: object
12948+
properties:
12949+
error:
12950+
description: OAuth2 error code
12951+
type: string
12952+
error_description:
12953+
description: Human-readable error description
12954+
type: string
12955+
required:
12956+
- error
12957+
- error_description
12958+
additionalProperties: false
12959+
components: {}
12960+
"403":
12961+
description: Default Response
12962+
content:
12963+
application/json:
12964+
schema:
12965+
schema:
12966+
description: Forbidden - Insufficient scope
12967+
type: object
12968+
properties:
12969+
error:
12970+
description: OAuth2 error code
12971+
type: string
12972+
error_description:
12973+
description: Human-readable error description
12974+
type: string
12975+
required:
12976+
- error
12977+
- error_description
12978+
additionalProperties: false
12979+
components: {}
12980+
"404":
12981+
description: Default Response
12982+
content:
12983+
application/json:
12984+
schema:
12985+
schema:
12986+
description: Not Found - User not found
12987+
type: object
12988+
properties:
12989+
error:
12990+
description: OAuth2 error code
12991+
type: string
12992+
error_description:
12993+
description: Human-readable error description
12994+
type: string
12995+
required:
12996+
- error
12997+
- error_description
12998+
additionalProperties: false
12999+
components: {}
13000+
"500":
13001+
description: Default Response
13002+
content:
13003+
application/json:
13004+
schema:
13005+
schema:
13006+
description: Internal Server Error
13007+
type: object
13008+
properties:
13009+
error:
13010+
description: OAuth2 error code
13011+
type: string
13012+
error_description:
13013+
description: Human-readable error description
13014+
type: string
13015+
required:
13016+
- error
13017+
- error_description
13018+
additionalProperties: false
13019+
components: {}
1289013020
/api/auth/email/register:
1289113021
post:
1289213022
summary: User registration via email

0 commit comments

Comments
 (0)