Click the following link and authorize, then copy the code you
get.
It is normal to get ERR_UNSAFE_PORT
error, you just need to copy the code between code=
and &scope=
in the errored url as Authorization Code.