Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit d326714

Browse files
authored
Merge pull request #38 from ezimuel/fix/route-docs
Fix for #36, added the /oauth route in docs
2 parents 5f0e718 + 24e58f3 commit d326714

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

docs/book/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="jumbotron">
33
<h1>zendframework/zend-expressive-authentication-oauth2</h1>
44

5-
<p>OAuth2 (server) authentication middleware for PSR-7 applications.</p>
5+
<p>OAuth2 (server) for Expressive and PSR-7 applications.</p>
66

77
<pre><code class="language-bash">$ composer require zendframework/zend-expressive-authentication-oauth2</code></pre>
88
</div>

docs/book/intro.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,23 @@ These commands will insert the following testing values:
112112
For security reason, the client `secret` and the user `password` are stored
113113
using the `bcrypt` algorithm provided by [password_hash](http://php.net/manual/en/function.password-hash.php)
114114
function of PHP.
115+
116+
## Configure the OAuth2 route
117+
118+
As last step, in order to use the OAuth2 server you need to configure a route
119+
to point to `Zend\Expressive\Authentication\OAuth2\OAuth2Middleware` with
120+
GET and POST HTTP verbs.
121+
122+
For instance, you can add the following route to your Expressive application:
123+
124+
```php
125+
$app->route(
126+
'/oauth',
127+
Zend\Expressive\Authentication\OAuth2\OAuth2Middleware::class,
128+
['GET', 'POST'],
129+
'oauth'
130+
);
131+
```
132+
133+
With this configuration, you can interact with the OAuth2 server using `/oauth`
134+
URL.

docs/book/usage.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
If you successfully configured the OAuth2 server as detailed in the
44
[installation](intro.md) section, you can request an access token using the
5-
default `/oauth` route.
5+
OAuth2 server route defined [before](intro.md#configure-the-oauth2-route)
6+
(e.g. `/oauth`).
67

78
You can require an access token using one of the following scenarios:
89

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ pages:
1111
- "Implicit": grant/implicit.md
1212
- "Refresh token": grant/refresh_token.md
1313
site_name: OAuth2 middleware
14-
site_description: 'OAuth2 server authentication middleware for Expressive and PSR-7 applications.'
14+
site_description: 'OAuth2 (server) for Expressive and PSR-7 applications.'
1515
repo_url: 'https://github.com/zendframework/zend-expressive-authentication-oauth2'
1616
copyright: 'Copyright (c) 2015-2018 <a href="http://www.zend.com/">Zend Technologies USA Inc.</a>'

0 commit comments

Comments
 (0)