Created
October 11, 2012 13:34
-
-
Save pilt/3872292 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if "HTTP_AUTHORIZATION" in self.request.META: | |
authorization = self.request.META["HTTP_AUTHORIZATION"] | |
auth_type, auth_value = authorization.split()[0:2] | |
if auth_type.lower() == "basic": | |
credentials = "%s:%s" % (self.client.key, self.client.secret) | |
if auth_value != b64encode(credentials): | |
raise InvalidClient('Client authentication failed.') | |
else: | |
raise InvalidClient('Client authentication failed.') | |
else: | |
raise InvalidClient('Client authentication failed.') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment