Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
class AuthorizationController extends Controller
{
public function authorize(Request $request, OAuthServer $server): RedirectResponse
public function start(Request $request, OAuthServer $server): RedirectResponse
{
$consentPath = config('oauth-server.console_authorize_path', '/oauth/authorize');

Expand Down
2 changes: 1 addition & 1 deletion src/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function ($router) {
$router->get('.well-known/openid-configuration', [Fleetbase\Http\Controllers\OAuthServer\DiscoveryController::class, 'configuration']);
$router->get('.well-known/oauth-authorization-server', [Fleetbase\Http\Controllers\OAuthServer\DiscoveryController::class, 'configuration']);
$router->prefix('oauth')->group(function ($router) {
$router->get('authorize', [Fleetbase\Http\Controllers\OAuthServer\AuthorizationController::class, 'authorize']);
$router->get('authorize', [Fleetbase\Http\Controllers\OAuthServer\AuthorizationController::class, 'start']);
$router->get('jwks', [Fleetbase\Http\Controllers\OAuthServer\DiscoveryController::class, 'jwks']);
$router->middleware(['throttle:600,1'])->group(function ($router) {
$router->post('token', [Fleetbase\Http\Controllers\OAuthServer\TokenController::class, 'token']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function oauth_console_command(Illuminate\Console\Command $command, array $input
it('sends a valid request to the console consent screen, and errors where they belong', function () {
[$client] = oauth_test_client();
$controller = new AuthorizationController();
$authorize = fn (array $query) => $controller->authorize(Request::create('/oauth/authorize', 'GET', $query), oauth_test_server())->getTargetUrl();
$authorize = fn (array $query) => $controller->start(Request::create('/oauth/authorize', 'GET', $query), oauth_test_server())->getTargetUrl();

expect($authorize(oauth_test_params($client, oauth_test_verifier())))->toStartWith('https://console.fleetbase.test/oauth/authorize?response_type=code&client_id=' . $client->id)
->and($authorize(oauth_test_params($client, oauth_test_verifier(), ['response_type' => 'token'])))->toStartWith(OAUTH_TEST_REDIRECT . '?error=unsupported_response_type')
Expand Down
Loading