Basic authentication on web api- .net core 2.0

Hello,

I am trying to make a call to /token and based on the username and password he will return me back the token.
It’s that even possible to be made on the web api?