Judging by the error message, likely the tenant you're using does not have a valid Exchange Online subscription. Make sure this isn't indeed the case. If you are just trying things in a demo tenant, sign up for a free O365/M365 trial to get Exchange enabled in the tenant.
Otherwise, share the actual code you're using to obtain the token.