For anyone wondering:
This way of doing is called "Device flow" and it's in the Oauth 2.0 Spec
Great explanation here