1 | <?php |
||
15 | class AuthCodeController extends OAuthController |
||
16 | { |
||
17 | public function init() |
||
32 | |||
33 | /** |
||
34 | * |
||
35 | * @SWG\Get( |
||
36 | * path="/oauth2/authorize", |
||
37 | * @SWG\Response(response="200", description="An access token"), |
||
38 | * tags={"auth"}, |
||
39 | * @SWG\Parameter( |
||
40 | * name="response_type", |
||
41 | * in="query", |
||
42 | * type="string", |
||
43 | * description="the type of response", |
||
44 | * required=true, |
||
45 | * default="code" |
||
46 | * ), |
||
47 | * @SWG\Parameter( |
||
48 | * name="client_id", |
||
49 | * in="query", |
||
50 | * type="string", |
||
51 | * description="the client identifier", |
||
52 | * required=true |
||
53 | * ), |
||
54 | * @SWG\Parameter( |
||
55 | * name="redirect_uri", |
||
56 | * in="query", |
||
57 | * type="string", |
||
58 | * description="where to send the response", |
||
59 | * required=false |
||
60 | * ), |
||
61 | * @SWG\Parameter( |
||
62 | * name="state", |
||
63 | * in="query", |
||
64 | * type="string", |
||
65 | * description="with a CSRF token. This parameter is optional but highly recommended.", |
||
66 | * required=false, |
||
67 | * ) |
||
68 | * ) |
||
69 | */ |
||
70 | public function authorizeAction() |
||
100 | |||
101 | |||
102 | |||
103 | /** |
||
104 | * @SWG\Post( |
||
105 | * path="/oauth2/access-token", |
||
106 | * operationId="accessToken", |
||
107 | * @SWG\Response(response="200", description="An access token"), |
||
108 | * tags={"auth"}, |
||
109 | * @SWG\Parameter( |
||
110 | * name="grant_type", |
||
111 | * in="body", |
||
112 | * type="string", |
||
113 | * description="the type of grant", |
||
114 | * required=true, |
||
115 | * default="authorization_code", |
||
116 | * @SWG\Schema(type="string") |
||
117 | * ), |
||
118 | * @SWG\Parameter( |
||
119 | * name="client_id", |
||
120 | * in="body", |
||
121 | * type="string", |
||
122 | * description="the client id", |
||
123 | * required=true, |
||
124 | * @SWG\Schema(type="string") |
||
125 | * ), |
||
126 | * @SWG\Parameter( |
||
127 | * name="client_secret", |
||
128 | * in="body", |
||
129 | * type="string", |
||
130 | * description="the client secret", |
||
131 | * required=true, |
||
132 | * @SWG\Schema(type="string") |
||
133 | * ), |
||
134 | * @SWG\Parameter( |
||
135 | * name="redirect_uri", |
||
136 | * in="body", |
||
137 | * type="string", |
||
138 | * description="with the same redirect URI the user was redirect back to", |
||
139 | * required=true, |
||
140 | * default="authorization_code", |
||
141 | * @SWG\Schema(type="string") |
||
142 | * ), |
||
143 | * @SWG\Parameter( |
||
144 | * name="code", |
||
145 | * in="body", |
||
146 | * type="string", |
||
147 | * description="with the authorization code from the query string", |
||
148 | * required=true, |
||
149 | * default="authorization_code", |
||
150 | * @SWG\Schema(type="string") |
||
151 | * ), |
||
152 | * ) |
||
153 | */ |
||
154 | public function accessTokenAction() |
||
174 | } |
||
175 |