# onSasl2Success method

1. @override

Future <Result<bool, NegotiatorError>> onSasl2Success(

1. XMLNode response

)
override

Called by the SASL2 negotiator when the SASL2 negotiations are done. `response` is the entire response nonza. This method is only called when the previous <inline> element contains an item with xmlns equal to negotiatingXmlns.</inline>

## Implementation

    @override
    Future<Result<bool, NegotiatorError>> onSasl2Success(XMLNode response) async {
      final tokenElement = response.firstTag('token', xmlns: fastXmlns);
      if (tokenElement != null) {
        final token = FASTToken.fromXml(tokenElement);
        fastToken = token.token;
        await attributes.sendEvent(
          NewFASTTokenReceivedEvent(token),
        );
      }

      state = NegotiatorState.done;
      return const Result(true);
    }