This repository was archived by the owner on Jan 29, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +24
-3
lines changed
Expand file tree Collapse file tree 4 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change @@ -112,3 +112,23 @@ These commands will insert the following testing values:
112112For security reason, the client ` secret ` and the user ` password ` are stored
113113using the ` bcrypt ` algorithm provided by [ password_hash] ( http://php.net/manual/en/function.password-hash.php )
114114function 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.
Original file line number Diff line number Diff line change 22
33If 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
78You can require an access token using one of the following scenarios:
89
Original file line number Diff line number Diff line change 1111 - " Implicit " : grant/implicit.md
1212 - " Refresh token " : grant/refresh_token.md
1313site_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.'
1515repo_url : ' https://github.com/zendframework/zend-expressive-authentication-oauth2'
1616copyright : ' Copyright (c) 2015-2018 <a href="http://www.zend.com/">Zend Technologies USA Inc.</a>'
You can’t perform that action at this time.
0 commit comments