There are several preliminary steps to obtain a token. See them further in this section:
Prerequisites for Moodle integration through LTI
Setting up the environment