Getting "Bearer token malformed" for oauth2

Take a look at this document which goes through most of the oauth flows with examples