Fixed OAuth 2.0 key bug and refactored cryptography code
Merge pull request #1435 from benjamij/moodle-updates

Fixed OAuth 2.0 key bug and refactored cryptography code