It works through postman because CORS is a browser implementation thing. Which is also why some calls might work through older IE versions.
Postman does not check the CORS header and thus does not care.
CORS is to prevent XSS (I believe).
https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS is great reading on the subject.
Cross-Origin Resource Sharing (CORS) is an HTTP-header based mechanism that allows a server to indicate any other origins (domain, scheme, or port) than its own from which a browser should permit loading of resources.
So basically it is telling you that the token service does not allow you to call it cross-origin.
CORS
is a response header that the browser checks.
- Browser sends request to token service
- Token service responds.
- Browser checks if CORS is allowed.
- No.
- Fail the "request".
TLDR; CORS
is a response header, that the browser checks for whether or not to allow the response to go through to you. The header must be set by the service you are calling.