def _check_authorization(self, properties, stream):
authzid = properties.get("<STR_LIT>")<EOL>if not authzid:<EOL><INDENT>return True<EOL><DEDENT>try:<EOL><INDENT>jid = JID(authzid)<EOL><DEDENT>except ValueError:<EOL><INDENT>return False<EOL><DEDENT>if "<STR_LIT:username>" not in properties:<EOL><INDENT>result = False<EOL><DEDENT>elif jid.local != properties["<STR_LIT:username>"]:<EOL><INDENT>result = False<EOL><DEDENT>elif jid.domain != stream.me.domain:<EOL><INDENT>result = False<EOL><DEDENT>elif jid.resource:<EOL><INDENT>result = False<EOL><DEDENT>else:<EOL><INDENT>result = True<EOL><DEDENT>return result<EOL>
Check authorization id and other properties returned by the
        authentication mechanism.

        [receiving entity only]

        Allow only no authzid or authzid equal to current username@domain

        FIXME: other rules in s2s

        :Parameters:
            - `properties`: data obtained during authentication
        :Types:
            - `properties`: mapping

        :return: `True` if user is authorized to use a provided authzid
        :returntype: `bool`