--- a/server/src/metaeducation/auth.py Thu Apr 21 11:04:20 2016 +0200
+++ b/server/src/metaeducation/auth.py Thu Apr 21 11:08:59 2016 +0200
@@ -67,15 +67,15 @@
if "uriredirect" not in validate_response_json.keys():
logger.warning("CLIENT_CREDENTIAL_AUTH: Token validate response doesn't have a redirect_uri key!")
- elif validate_response_json["redirect_uri"] != parse.quote_plus(settings.MTDC_GED_REDIRECT_URI):
+ elif validate_response_json["uriredirect"] != parse.quote_plus(settings.MTDC_GED_REDIRECT_URI):
logger.warning("CLIENT_CREDENTIAL_AUTH: redirect_uri in response %r is different from redirect_uri transmitted in request %r", validate_response_json["redirect_uri"], parse.quote_plus(settings.MTDC_GED_REDIRECT_URI))
if "error" not in validate_response_json.keys():
logger.warning("CLIENT_CREDENTIAL_AUTH: Token validate response doesn't have an error key!")
- logger.warning("CLIENT_CREDENTIAL_AUTH: Aborting as the errors keys is required to check if token was validated")
+ logger.warning("CLIENT_CREDENTIAL_AUTH: Aborting as the error keys is required to check if token was validated")
logger.warning("CLIENT_CREDENTIAL_AUTH: Response was %r", validate_response_json)
raise exceptions.AuthenticationFailed("CLIENT_CREDENTIAL_AUTH: Token validate response doesn't have an error key!")
- elif validate_response_json["errors"] != "0" :
+ elif validate_response_json["error"] != "0" :
logger.debug("CLIENT CREDENTIAL AUTH: There was an error validating the token: %r", validate_response_json.get("description", "no error description in json response"))
raise exceptions.AuthenticationFailed("CLIENT CREDENTIAL AUTH: There was an error validating the token")