Authentication failed trying to get channel subscribers

Send user to twitch with url:
https://id.twitch.tv/oauth2/authorize?client_id=<client-id>&amp;redirect_uri=http%3A%2F%2Flocalhost&amp;response_type=code&amp;scope=channel%3Aread%3Asubscriptions+channel_subscriptions

Then taking the code from the redirect perform a post to:
https://id.twitch.tv/oauth2/token?client_id=<client-id>&client_secret=<secret>&code=<the-code>&grant_type=authorization_code&redirect_uri=http%3A%2F%2Flocalhost

Then perform the request to the channel using the returned “access_token”. Is that not the correct flow?