Skip to content

Commit

Permalink
misc typos and fixes
Browse files Browse the repository at this point in the history
 - 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")
  • Loading branch information
danopz authored and bshaffer committed Oct 7, 2015
1 parent ec19132 commit d91c78d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"require": {
"silex/silex": "1.2.*@dev",
"symfony/twig-bridge": "2.1.*",
"bshaffer/oauth2-server-php": "v1.6",
"bshaffer/oauth2-server-php": "~1.8.0",
"bshaffer/oauth2-server-httpfoundation-bridge": "v1.1",
"guzzle/guzzle": "~3.7"
},
Expand Down
6 changes: 6 additions & 0 deletions src/OAuth2Demo/Client/Controllers/ReceiveImplicitToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@ public static function addRoutes($routing)

public function receiveImplicitToken(Application $app)
{
$request = $app['request']; // the request object
$twig = $app['twig']; // used to render twig templates

// the user denied the authorization request
if ($request->get('error')) {
return $twig->render('client/failed_token_request.twig', array('response' => $request->getAllQueryParameters()));
}

// nothing to do - implicit tokens are in the URL Fragment, so it must be done by the browser

return $twig->render('client/show_implicit_token.twig');
Expand Down
2 changes: 1 addition & 1 deletion views/client/show_implicit_token.twig
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
Now use this token to make a request to the OAuth2.0 Server's APIs:
</p>

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

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

Expand Down
2 changes: 1 addition & 1 deletion views/server/authorize.twig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<li>make your life better</li>
<li>miscellaneous nefarious purposes</li>
</ul>
<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}}.
<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}}.
<ul class="authorize_options">
<li>
<form action="{{ path('authorize_post') ~ '?' ~ app.request.queryString }}" method="post">
Expand Down

0 comments on commit d91c78d

Please sign in to comment.