You can gain an access token and refresh token pair and you can store them for use later. You only need the refresh token, since it can be used to get a new access token.
This is slightly better than username/password because you can revoke access to the token at any time if it has been leaked.