def login(self, username, password):
<EOL>url = Client.ENDPOINT.format('<STR_LIT>')<EOL>params = {<EOL>'<STR_LIT>': self.apiKey,<EOL>'<STR_LIT:username>': username,<EOL>'<STR_LIT:password>': password,<EOL>}<EOL>returned = get(url, params=params)<EOL>self.checkResponse(returned)<EOL>root = ET.fromstring(returned.text)<EOL>if root.text.startswith('<STR_LIT>'):<EOL><INDENT>self.userHash = '<STR_LIT>'<EOL>raise InvalidLoginCredentials('<STR_LIT>')<EOL><DEDENT>self.userHash = root.text<EOL>return True<EOL>
Logs into Brickset as a user, returning a userhash, which can be used in other methods.
The user hash is stored inside the client (:attr:`userHash`).

:param str username: Your Brickset username.
:param str password: Your Brickset password.
:returns: If the login is valid, this will return ``True``.
:rtype: `bool`
:raises: :class:`brickfront.errors.InvalidLoginCredentials`