first try to implement http://tools.ietf.org/html/rfc6749#section-4.4