You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You should follow three steps below to work with Play Framework.
123
+
You should follow four steps below to work with Play Framework.
125
124
125
+
* Customizing Grant Handlers
126
126
* Define a controller to issue access token
127
127
* Assign a route to the controller
128
128
* Access to an authorized resource
129
129
130
-
First, define your own controller with mixining ```OAuth2Provider``` trait provided by this library to issue access token.
130
+
You want to use which grant types are supported or to use a customized handler for a grant type, you should override the ```handlers``` map in a customized ```TokenEndpoint``` trait.
Here's an example of a customized ```TokenEndpoint``` that 1) only supports the ```password``` grant type, and 2) customizes the ```password``` grant type handler to not require client credentials:
145
+
146
+
```scala
147
+
classMyTokenEndpointextendsTokenEndpoint {
148
+
valpasswordNoCred=newPassword() {
149
+
overridedefclientCredentialRequired=false
150
+
}
151
+
152
+
overridevalhandlers=Map(
153
+
OAuthGrantType.PASSWORD-> passwordNoCred
154
+
)
155
+
}
156
+
```
157
+
158
+
Define your own controller with mixining ```OAuth2Provider``` trait provided by this library to issue access token with customized `TokenEndpoint`.
0 commit comments