Comment updated to clarify that this function should be used in both Resource Owner Password Credentials Grant and Implicit Grant