Fix for oauth bug

Fixed issue with OAuth returning 500/400 error.