Skip to content

Commit

Permalink
Merge pull request #74 from trikoder/remove-methods-that-dont-work
Browse files Browse the repository at this point in the history
Remove route methods that aren't supported by the oauth2 server
  • Loading branch information
X-Coder264 authored Jul 2, 2019
2 parents 895618b + 733ba74 commit 51ef5ae
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ This package is currently in the active development.
resource: '@TrikoderOAuth2Bundle/Resources/config/routes.xml'
```

You can verify that everything is working by issuing a `GET` request to the `/token` endpoint.
You can verify that everything is working by issuing a `POST` request to the `/token` endpoint.

**❮ NOTE ❯** It is recommended to control the access to the authorization endpoint
so that only logged in users can approve authorization requests.
Expand Down
4 changes: 2 additions & 2 deletions Resources/config/routes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
xsi:schemaLocation="http://symfony.com/schema/routing
http://symfony.com/schema/routing/routing-1.0.xsd">

<route id="oauth2_authorize" path="/authorize" controller="trikoder.oauth2.controller.authorization_controller:indexAction" methods="GET|POST" />
<route id="oauth2_token" path="/token" controller="trikoder.oauth2.controller.token_controller:indexAction" methods="GET|POST" />
<route id="oauth2_authorize" path="/authorize" controller="trikoder.oauth2.controller.authorization_controller:indexAction" methods="GET" />
<route id="oauth2_token" path="/token" controller="trikoder.oauth2.controller.token_controller:indexAction" methods="POST" />
</routes>
2 changes: 1 addition & 1 deletion Tests/Acceptance/TokenEndpointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function testSuccessfulAuthorizationCodeRequest(): void

public function testFailedTokenRequest(): void
{
$this->client->request('GET', '/token');
$this->client->request('POST', '/token');

$response = $this->client->getResponse();

Expand Down

0 comments on commit 51ef5ae

Please sign in to comment.