Commits

Vladimir Mihailenco committed 0527244

Add some logging

Comments (0)

Files changed (1)

oauth_provider/utils.py

+import logging
+
 import oauth2 as oauth
 from urlparse import urlparse
 
                                       [])
 
 
+logger = logging.getLogger()
+
+
 def get_oauth_server():
     """Shortcut for initialization."""
     oauth_server = oauth.Server()
     # Check nonce
     if not store.check_nonce(request, oauth_request,
                              oauth_request['oauth_nonce']):
+        logger.info('Nonce "%s" check failed' % oauth_request['oauth_nonce'])
         return False
 
     # Verify request
 
         oauth_server.verify_request(oauth_request, consumer, token)
     except oauth.Error:
+        msg = ('Request check for consumer "%s" failed with parameters: %r' %
+               (consumer, oauth_request))
+        logger.info(msg)
         return False
 
     return True