I have this working piece of shell code, which gives me back an access token:
curl -X POST http://127.0.0.1:8080/auth/realms/master/protoco