File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -153,8 +153,8 @@ If you'd like to change the OAuth workflow, modify handleRequest methods of Toke
153153### Customizing Grant Handlers
154154
155155If you want to change which grant types are supported or to use a customized handler for a grant type, you can
156- override the ``` handlers ``` map in a customized ``` TokenEndpoint ``` trait since version 0.10.0 . Here's an example of a customized
157- ``` TokenEndpoint ``` that 1) only supports the ``` password ``` grant type, and 2) customizes the ``password``` grant
156+ override the ``` handlers ``` map in a customized ``` TokenEndpoint ``` trait. Here's an example of a customized
157+ ``` TokenEndpoint ``` that 1) only supports the ``` password ``` grant type, and 2) customizes the ``` password ``` grant
158158type handler to not require client credentials:
159159
160160``` scala
@@ -169,6 +169,24 @@ class MyTokenEndpoint extends TokenEndpoint {
169169}
170170```
171171
172+ ### Using Action composition
173+
174+ You can write more easily authorize action by using Action composition.
175+
176+ Playframework's documentation is [ here] ( https://www.playframework.com/documentation/2.3.x/ScalaActionsComposition ) .
177+
178+ ``` scala
179+ object MyController extends Controller {
180+
181+ import scalaoauth2 .provider .OAuth2ProviderActionBuilders ._
182+
183+ def list = AuthorizedAction (new MyDataHandler ()) { request =>
184+ val user = request.authInfo.user // User is defined on your system
185+ // access resource for the user
186+ }
187+ }
188+ ```
189+
172190## Examples
173191
174192### Playframework 2.3
You can’t perform that action at this time.
0 commit comments