def METHOD_NAME(self):
    metadata = {'grant_types_supported': ['authorization_code', 'password']}
    self.prepare_data(metadata=metadata)
    headers = {'Authorization': 'bearer abc'}
    body = {'grant_types': ['password'], 'client_name': 'Authlib'}
    rv = self.client.post('/create_client', json=body, headers=headers)
    resp = json.loads(rv.data)
    self.assertIn('client_id', resp)
    self.assertEqual(resp['client_name'], 'Authlib')
    # https://www.rfc-editor.org/rfc/rfc7591.html#section-2
    # If omitted, the default behavior is that the client will use only
    # the "authorization_code" Grant Type.
    body = {'client_name': 'Authlib'}
    rv = self.client.post('/create_client', json=body, headers=headers)
    resp = json.loads(rv.data)
    self.assertIn('client_id', resp)
    self.assertEqual(resp['client_name'], 'Authlib')
    body = {'grant_types': ['client_credentials'], 'client_name': 'Authlib'}
    rv = self.client.post('/create_client', json=body, headers=headers)
    resp = json.loads(rv.data)
    self.assertIn(resp['error'], 'invalid_client_metadata')