obtainAuthInfoByRedirectUri method

  1. @override
Future<Result<AuthInfo>> obtainAuthInfoByRedirectUri(
  1. String redirectBackUri
)
override

Implementation

@override
Future<Result<AuthInfo>> obtainAuthInfoByRedirectUri(
    String redirectBackUri) async {
  late Uri uri;
  try {
    uri = Uri.parse(redirectBackUri);
  } catch (e) {
    return Result.failure(StatusCode.localSdkError, "${e.toString()} (6000)");
  }

  final String? authCode = uri.queryParameters["code"];
  if (authCode == null) {
    return Result.failure(
        StatusCode.localSdkError, "The code parameter is missing (6001)");
  }
  final result = await OIDCClient.authByCode(authCode, _authRequest);
  return result.toOddsAuthResult();
}