|
56 | 56 | AbstractApplication.GRANT_CLIENT_CREDENTIALS,
|
57 | 57 | AbstractApplication.GRANT_OPENID_HYBRID,
|
58 | 58 | ),
|
59 |
| - "urn:ietf:params:oauth:grant-type:device_code": (AbstractApplication.GRANT_DEVICE_CODE,) |
| 59 | + "urn:ietf:params:oauth:grant-type:device_code": (AbstractApplication.GRANT_DEVICE_CODE,), |
60 | 60 | }
|
61 | 61 |
|
62 | 62 | Application = get_application_model()
|
@@ -167,8 +167,9 @@ def _authenticate_basic_auth(self, request):
|
167 | 167 | elif request.client.client_id != client_id:
|
168 | 168 | log.debug("Failed basic auth: wrong client id %s" % client_id)
|
169 | 169 | return False
|
170 |
| - elif (request.client.client_type == "public" |
171 |
| - and request.grant_type == "urn:ietf:params:oauth:grant-type:device_code" |
| 170 | + elif ( |
| 171 | + request.client.client_type == "public" |
| 172 | + and request.grant_type == "urn:ietf:params:oauth:grant-type:device_code" |
172 | 173 | ):
|
173 | 174 | return True
|
174 | 175 | elif not self._check_secret(client_secret, request.client.client_secret):
|
@@ -196,6 +197,11 @@ def _authenticate_request_body(self, request):
|
196 | 197 | if self._load_application(client_id, request) is None:
|
197 | 198 | log.debug("Failed body auth: Application %s does not exists" % client_id)
|
198 | 199 | return False
|
| 200 | + elif ( |
| 201 | + request.client.client_type == "public" |
| 202 | + and request.grant_type == "urn:ietf:params:oauth:grant-type:device_code" |
| 203 | + ): |
| 204 | + return True |
199 | 205 | elif not self._check_secret(client_secret, request.client.client_secret):
|
200 | 206 | log.debug("Failed body auth: wrong client secret %s" % client_secret)
|
201 | 207 | return False
|
|
0 commit comments