"Invalid authorization code" error can be generated by:
- A corrupted code (like adding extra space before or after the code, missing characters...)
- Using the code after 5 minutes (codes last about ~5mins long).
- Reusing the same code twice (it is only valid once).
If you need more information
Check out this documentation with more details about the issue.