Then you’re using the wrong OAuth flow, the token and code flows are for User Tokens and so require sending the user to Twitch.
As Barry linked to you, you need to properly implement the client_credentials flow for an App token that can be used entirely server-side.