Skip to content

Commit eb6e711

Browse files
committed
Devices that are public should not need basic auth
The device flow is initiated by sending the client_id and and a scope. This check should not fail if the client is public
1 parent 1bcc1b0 commit eb6e711

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

oauth2_provider/oauth2_validators.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ def _authenticate_basic_auth(self, request):
167167
elif request.client.client_id != client_id:
168168
log.debug("Failed basic auth: wrong client id %s" % client_id)
169169
return False
170+
elif (request.client.client_type == "public"
171+
and request.grant_type == "urn:ietf:params:oauth:grant-type:device_code"
172+
):
173+
return True
170174
elif not self._check_secret(client_secret, request.client.client_secret):
171175
log.debug("Failed basic auth: wrong client secret %s" % client_secret)
172176
return False

0 commit comments

Comments
 (0)