コード例 #1
0
        internal static OobResult ApproveOob(string username,
                                             Dictionary <string, string> parameters,
                                             IUi ui,
                                             RestClient rest)
        {
            if (!parameters.TryGetValue("outofbandtype", out var method))
            {
                throw new InternalErrorException("Out of band method is not specified");
            }

            return(method switch
            {
                "lastpassauth" => ui.ApproveLastPassAuth(),
                "duo" => ApproveDuo(username, parameters, ui, rest),
                _ => throw new UnsupportedFeatureException($"Out of band method '{method}' is not supported")
            });