Skip to content

Commit d91c78d

Browse files
danopzbshaffer
authored andcommitted
misc typos and fixes
- add check to error in receive_implicit to render a failed request view - fixed resource request link to contain correct access_token - fixed typo in authorize.twig - update to oauth2-server-php 1.8 to fix oidc Authorization Code + ID Token flow (missing response type "code id_token")
1 parent ec19132 commit d91c78d

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"require": {
33
"silex/silex": "1.2.*@dev",
44
"symfony/twig-bridge": "2.1.*",
5-
"bshaffer/oauth2-server-php": "v1.6",
5+
"bshaffer/oauth2-server-php": "~1.8.0",
66
"bshaffer/oauth2-server-httpfoundation-bridge": "v1.1",
77
"guzzle/guzzle": "~3.7"
88
},

src/OAuth2Demo/Client/Controllers/ReceiveImplicitToken.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@ public static function addRoutes($routing)
1313

1414
public function receiveImplicitToken(Application $app)
1515
{
16+
$request = $app['request']; // the request object
1617
$twig = $app['twig']; // used to render twig templates
1718

19+
// the user denied the authorization request
20+
if ($request->get('error')) {
21+
return $twig->render('client/failed_token_request.twig', array('response' => $request->getAllQueryParameters()));
22+
}
23+
1824
// nothing to do - implicit tokens are in the URL Fragment, so it must be done by the browser
1925

2026
return $twig->render('client/show_implicit_token.twig');

views/client/show_implicit_token.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
Now use this token to make a request to the OAuth2.0 Server's APIs:
3232
</p>
3333

34-
<a class="button" href="{{ path('request_resource') }}" onclick="this.href += '?token='+getAccessToken();">make a resource request</a>
34+
<a class="button" href="{{ path('request_resource') }}" onclick="this.href += '?token='+getAccessToken().access_token;">make a resource request</a>
3535

3636
<div class="help"><em>This token can now be used multiple times to make API requests for this user.</em></div>
3737

views/server/authorize.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<li>make your life better</li>
2020
<li>miscellaneous nefarious purposes</li>
2121
</ul>
22-
<p>Click the button below to complete the authorize request and grant an <code>{{ response_type == 'code' ? 'Authoriation Code' : 'Access Token' }}</code> to {{client_id}}.
22+
<p>Click the button below to complete the authorize request and grant an <code>{{ response_type == 'code' ? 'Authorization Code' : 'Access Token' }}</code> to {{client_id}}.
2323
<ul class="authorize_options">
2424
<li>
2525
<form action="{{ path('authorize_post') ~ '?' ~ app.request.queryString }}" method="post">

0 commit comments

Comments
 (0)