getChallengeResponse method
Implementation
Future<ChallengeResponse> getChallengeResponse(String accountId,
[int? memo, String? homeDomain, String? clientDomain]) async {
if (memo != null && accountId.startsWith("M")) {
throw NoMemoForMuxedAccountsException();
}
Uri serverURI = Uri.parse(_authEndpoint);
try {
_ChallengeRequestBuilder requestBuilder =
new _ChallengeRequestBuilder(httpClient, serverURI);
ChallengeResponse response = await requestBuilder
.forAccountId(accountId)
.forHomeDomain(homeDomain)
.forClientDomain(clientDomain)
.forMemo(memo)
.execute();
return response;
} catch (e) {
if (e is ErrorResponse) {
throw new ChallengeRequestErrorResponse(e.code, e.body);
} else {
throw e;
}
}
}