# getRawStep method

1. @override

Future <String> getRawStep(

1. String input

)
override

Perform a SASL step with `input` as the already parsed input data. Returns the base64-encoded response data.

## Implementation

    @override
    Future<String> getRawStep(String input) async {
      switch (_scramState) {
        case ScramState.preSent:
          if (clientNonce == null || clientNonce == '') {
            clientNonce = randomAlphaNumeric(
              40,
              provider: CoreRandomProvider.from(Random.secure()),
            );
          }

          initialMessageNoGS2 =
              'n=${attributes.getConnectionSettings().jid.local},r=$clientNonce';

          _scramState = ScramState.initialMessageSent;
          return base64.encode(utf8.encode(gs2Header + initialMessageNoGS2));
        case ScramState.initialMessageSent:
          final challengeBase64 = input;
          final response = await calculateChallengeResponse(challengeBase64);
          final responseBase64 = base64.encode(utf8.encode(response));
          _scramState = ScramState.challengeResponseSent;

          return responseBase64;
        case ScramState.challengeResponseSent:
        case ScramState.error:
          return '';
      }
    }