@@ -6,70 +6,58 @@ import scala.concurrent.Future
66 *
77 * <h3>[Authorization phases]</h3>
88 *
9- * <h4>Authorization Code Grant</h4>
10- * <ul>
11- * <li>validateClient(request)</li>
12- * <li>findAuthInfoByCode(code)</li>
13- * <li>deleteAuthCode(code)</li>
14- * <li>getStoredAccessToken(authInfo)</li>
15- * <li>refreshAccessToken(authInfo, token)</li>
16- * <li>createAccessToken(authInfo)</li>
17- * </ul>
9+ * <h4>Authorization Code Grant</h4> <ul> <li>validateClient(request)</li>
10+ * <li>findAuthInfoByCode(code)</li> <li>deleteAuthCode(code)</li>
11+ * <li>getStoredAccessToken(authInfo)</li> <li>refreshAccessToken(authInfo,
12+ * token)</li> <li>createAccessToken(authInfo)</li> </ul>
1813 *
19- * <h4>Refresh Token Grant</h4>
20- * <ul>
21- * <li>validateClient(clientCredential, grantType)</li>
22- * <li>findAuthInfoByRefreshToken(refreshToken)</li>
23- * <li>refreshAccessToken(authInfo, refreshToken)</li>
24- * </ul>
14+ * <h4>Refresh Token Grant</h4> <ul> <li>validateClient(clientCredential,
15+ * grantType)</li> <li>findAuthInfoByRefreshToken(refreshToken)</li>
16+ * <li>refreshAccessToken(authInfo, refreshToken)</li> </ul>
2517 *
26- * <h4>Resource Owner Password Credentials Grant</h4>
27- * <ul>
28- * <li>validateClient(request)</li>
29- * <li>findUser(request)</li>
30- * <li>getStoredAccessToken(authInfo)</li>
31- * <li>refreshAccessToken(authInfo, token)</li>
32- * <li>createAccessToken(authInfo)</li>
33- * </ul>
18+ * <h4>Resource Owner Password Credentials Grant</h4> <ul>
19+ * <li>validateClient(request)</li> <li>findUser(request)</li>
20+ * <li>getStoredAccessToken(authInfo)</li> <li>refreshAccessToken(authInfo,
21+ * token)</li> <li>createAccessToken(authInfo)</li> </ul>
3422 *
35- * <h4>Client Credentials Grant</h4>
36- * <ul>
37- * <li>validateClient(request)</li>
38- * <li>findUser(request)</li>
39- * <li>getStoredAccessToken(authInfo)</li>
40- * <li>refreshAccessToken(authInfo, token)</li>
41- * <li>createAccessToken(authInfo)</li>
42- * </ul>
23+ * <h4>Client Credentials Grant</h4> <ul> <li>validateClient(request)</li>
24+ * <li>findUser(request)</li> <li>getStoredAccessToken(authInfo)</li>
25+ * <li>refreshAccessToken(authInfo, token)</li>
26+ * <li>createAccessToken(authInfo)</li> </ul>
4327 *
44- * <h4>Implicit Grant</h4>
45- * <ul>
46- * <li>validateClient(request)</li>
47- * <li>findUser(request)</li>
48- * <li>getStoredAccessToken(authInfo)</li>
49- * <li>createAccessToken(authInfo)</li>
50- * </ul>
28+ * <h4>Implicit Grant</h4> <ul> <li>validateClient(request)</li>
29+ * <li>findUser(request)</li> <li>getStoredAccessToken(authInfo)</li>
30+ * <li>createAccessToken(authInfo)</li> </ul>
5131 */
5232trait AuthorizationHandler [U ] {
5333
54- /** Verify proper client with parameters for issue an access token.
55- * Note that per the OAuth Specification, a Client may be valid if it only contains a client ID but no client
56- * secret (common with Public Clients). However, if the registered client has a client secret value the specification
57- * requires that a client secret must always be provided and verified for that client ID.
34+ /** Verify proper client with parameters for issue an access token. Note that
35+ * per the OAuth Specification, a Client may be valid if it only contains a
36+ * client ID but no client secret (common with Public Clients). However, if
37+ * the registered client has a client secret value the specification requires
38+ * that a client secret must always be provided and verified for that client
39+ * ID.
5840 *
59- * @param maybeCredential client credential parsed from request
60- * @param request Request sent by client.
61- * @return true if request is a regular client, false if request is a illegal client.
41+ * @param maybeCredential
42+ * client credential parsed from request
43+ * @param request
44+ * Request sent by client.
45+ * @return
46+ * true if request is a regular client, false if request is a illegal
47+ * client.
6248 */
6349 def validateClient (
6450 maybeCredential : Option [ClientCredential ],
6551 request : AuthorizationRequest
6652 ): Future [Boolean ]
6753
68- /** Authenticate the user that issued the authorization request.
69- * Client credential, Password and Implicit Grant call this method.
54+ /** Authenticate the user that issued the authorization request. Client
55+ * credential, Password and Implicit Grant call this method.
7056 *
71- * @param maybeCredential client credential parsed from request
72- * @param request Request sent by client.
57+ * @param maybeCredential
58+ * client credential parsed from request
59+ * @param request
60+ * Request sent by client.
7361 */
7462 def findUser (
7563 maybeCredential : Option [ClientCredential ],
@@ -78,24 +66,30 @@ trait AuthorizationHandler[U] {
7866
7967 /** Creates a new access token by authorized information.
8068 *
81- * @param authInfo This value is already authorized by system.
82- * @return Access token returns to client.
69+ * @param authInfo
70+ * This value is already authorized by system.
71+ * @return
72+ * Access token returns to client.
8373 */
8474 def createAccessToken (authInfo : AuthInfo [U ]): Future [AccessToken ]
8575
8676 /** Returns stored access token by authorized information.
8777 *
8878 * If want to create new access token then have to return None
8979 *
90- * @param authInfo This value is already authorized by system.
91- * @return Access token returns to client.
80+ * @param authInfo
81+ * This value is already authorized by system.
82+ * @return
83+ * Access token returns to client.
9284 */
9385 def getStoredAccessToken (authInfo : AuthInfo [U ]): Future [Option [AccessToken ]]
9486
9587 /** Creates a new access token by refreshToken.
9688 *
97- * @param authInfo This value is already authorized by system.
98- * @return Access token returns to client.
89+ * @param authInfo
90+ * This value is already authorized by system.
91+ * @return
92+ * Access token returns to client.
9993 */
10094 def refreshAccessToken (
10195 authInfo : AuthInfo [U ],
@@ -104,30 +98,37 @@ trait AuthorizationHandler[U] {
10498
10599 /** Find authorized information by authorization code.
106100 *
107- * If you don't support Authorization Code Grant then doesn't need implementing.
101+ * If you don't support Authorization Code Grant then doesn't need
102+ * implementing.
108103 *
109- * @param code Client sends authorization code which is registered by system.
110- * @return Return authorized information that matched the code.
104+ * @param code
105+ * Client sends authorization code which is registered by system.
106+ * @return
107+ * Return authorized information that matched the code.
111108 */
112109 def findAuthInfoByCode (code : String ): Future [Option [AuthInfo [U ]]]
113110
114111 /** Deletes an authorization code.
115112 *
116- * Called when an AccessToken has been successfully issued via an authorization code.
113+ * Called when an AccessToken has been successfully issued via an
114+ * authorization code.
117115 *
118- * If you don't support Authorization Code Grant, then you don't need to implement this
119- * method.
116+ * If you don't support Authorization Code Grant, then you don't need to
117+ * implement this method.
120118 *
121- * @param code Client-sent authorization code
119+ * @param code
120+ * Client-sent authorization code
122121 */
123122 def deleteAuthCode (code : String ): Future [Unit ]
124123
125124 /** Find authorized information by refresh token.
126125 *
127126 * If you don't support Refresh Token Grant then doesn't need implementing.
128127 *
129- * @param refreshToken Client sends refresh token which is created by system.
130- * @return Return authorized information that matched the refresh token.
128+ * @param refreshToken
129+ * Client sends refresh token which is created by system.
130+ * @return
131+ * Return authorized information that matched the refresh token.
131132 */
132133 def findAuthInfoByRefreshToken (
133134 refreshToken : String
0 commit comments