Skip to content

Commit 59f315f

Browse files
chore: Add PR's requested changes and additional AI comments
1 parent 9448328 commit 59f315f

3 files changed

Lines changed: 16 additions & 4 deletions

File tree

app/Http/Controllers/OAuth2/OAuth2ProviderController.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function __construct
9292
new OA\Parameter(name: 'state', in: 'query', required: false, description: 'Opaque state parameter returned in the redirect', schema: new OA\Schema(type: 'string')),
9393
new OA\Parameter(name: 'nonce', in: 'query', required: false, description: 'Nonce for ID token replay protection (OIDC)', schema: new OA\Schema(type: 'string')),
9494
new OA\Parameter(name: 'response_mode', in: 'query', required: false, description: 'Response mode override', schema: new OA\Schema(type: 'string', enum: ['query', 'fragment', 'form_post', 'direct'])),
95-
new OA\Parameter(name: 'prompt', in: 'query', required: false, description: 'Space-delimited user interaction prompts (OIDC)', schema: new OA\Schema(type: 'string', enum: ['none', 'login', 'consent', 'select_account'])),
95+
new OA\Parameter(name: 'prompt', in: 'query', required: false, description: 'Space-delimited user interaction prompts (OIDC). Allowed tokens: none, login, consent, select_account. "none" cannot be combined with others. Example: "login consent"', schema: new OA\Schema(type: 'string')),
9696
new OA\Parameter(name: 'login_hint', in: 'query', required: false, description: 'Hint about login identifier (OIDC)', schema: new OA\Schema(type: 'string')),
9797
new OA\Parameter(name: 'display', in: 'query', required: false, description: 'UI display preference (OIDC)', schema: new OA\Schema(type: 'string', enum: ['page', 'popup', 'touch', 'wap', 'native'])),
9898
new OA\Parameter(name: 'max_age', in: 'query', required: false, description: 'Maximum authentication age in seconds (OIDC)', schema: new OA\Schema(type: 'integer')),
@@ -255,7 +255,6 @@ public function auth()
255255
summary: 'OAuth2 Token Endpoint',
256256
description: 'Issues access tokens. Supports authorization_code, client_credentials, password, refresh_token, and passwordless grant types.',
257257
tags: ['OAuth2 / OpenID Connect'],
258-
security: [['OAuth2ProviderSecurity' => []]],
259258
requestBody: new OA\RequestBody(
260259
description: 'Token request parameters',
261260
required: true,
@@ -423,7 +422,17 @@ public function certs()
423422
path: '/.well-known/openid-configuration',
424423
operationId: 'oauth2Discovery',
425424
summary: 'OpenID Connect Discovery Endpoint',
426-
description: 'Returns the OpenID Provider Configuration document per OpenID Connect Discovery 1.0. Also available at /oauth2/.well-known/openid-configuration.',
425+
description: 'Returns the OpenID Provider Configuration document per OpenID Connect Discovery 1.0.',
426+
tags: ['OAuth2 / OpenID Connect'],
427+
responses: [
428+
new OA\Response(response: HttpResponse::HTTP_OK, description: 'OpenID Connect Discovery document', content: new OA\JsonContent(ref: '#/components/schemas/OpenIDDiscoveryResponse')),
429+
]
430+
)]
431+
#[OA\Get(
432+
path: '/oauth2/.well-known/openid-configuration',
433+
operationId: 'oauth2Discovery',
434+
summary: 'OpenID Connect Discovery Endpoint',
435+
description: 'Returns the OpenID Provider Configuration document per OpenID Connect Discovery 1.0.',
427436
tags: ['OAuth2 / OpenID Connect'],
428437
responses: [
429438
new OA\Response(response: HttpResponse::HTTP_OK, description: 'OpenID Connect Discovery document', content: new OA\JsonContent(ref: '#/components/schemas/OpenIDDiscoveryResponse')),

app/Swagger/OAuth2ProviderControllerSchemas.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
title: 'OAuth2 Token Response',
1010
description: 'Successful token response per RFC 6749 §5.1',
1111
type: 'object',
12+
required: ['access_token', 'token_type'],
1213
properties: [
1314
new OA\Property(property: 'access_token', type: 'string', description: 'The access token issued by the authorization server'),
1415
new OA\Property(property: 'token_type', type: 'string', description: 'The type of the token (typically Bearer)', example: 'Bearer'),
@@ -87,6 +88,7 @@ class OAuth2IntrospectionResponseSchema
8788
title: 'JSON Web Key Set',
8889
description: 'JWK Set document per RFC 7517',
8990
type: 'object',
91+
required: ['keys'],
9092
properties: [
9193
new OA\Property(
9294
property: 'keys',
@@ -115,6 +117,7 @@ class JWKSResponseSchema
115117
title: 'OpenID Connect Discovery Document',
116118
description: 'OpenID Provider Configuration per OpenID Connect Discovery 1.0',
117119
type: 'object',
120+
required: ['issuer', 'authorization_endpoint', 'token_endpoint', 'jwks_uri', 'response_types_supported', 'subject_types_supported', 'id_token_signing_alg_values_supported'],
118121
properties: [
119122
new OA\Property(property: 'issuer', type: 'string', format: 'uri', description: 'Issuer identifier URL'),
120123
new OA\Property(property: 'authorization_endpoint', type: 'string', format: 'uri', description: 'Authorization endpoint URL'),

app/Swagger/Requests/OAuth2AuthorizationRequestSchema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
new OA\Property(property: 'state', type: 'string', description: 'Opaque state parameter'),
1919
new OA\Property(property: 'nonce', type: 'string', description: 'Nonce for ID token replay protection'),
2020
new OA\Property(property: 'response_mode', type: 'string', description: 'Response mode override', enum: ['query', 'fragment', 'form_post', 'direct']),
21-
new OA\Property(property: 'prompt', type: 'string', description: 'User interaction prompts'),
21+
new OA\Property(property: 'prompt', type: 'string', description: 'Space-delimited user interaction prompts (OIDC). Allowed tokens: none, login, consent, select_account. "none" cannot be combined with others. Example: "login consent"'),
2222
new OA\Property(property: 'login_hint', type: 'string', description: 'Login identifier hint'),
2323
new OA\Property(property: 'code_challenge', type: 'string', description: 'PKCE code challenge'),
2424
new OA\Property(property: 'code_challenge_method', type: 'string', description: 'PKCE challenge method', enum: ['plain', 'S256']),

0 commit comments

Comments
 (0)