远程检查交换的凭证,检查用户登录 [英] Check exchange credentials remotely and check user logged in

查看:131
本文介绍了远程检查交换的凭证,检查用户登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我也没有太大的成功尝试这一点。基本上我需要远程登录使用EWS交流。

I have attempted this with not much success. Basically I need to login to Exchange using EWS remotely.

问题是我不知道如果用户在确定已登录凭据是否错了,因为我得到什么回来了!如果我错了提供凭据的软件,只进行!

The issue is I don't know if the user has logged in OK or if the credentials are wrong as I get nothing back! If I provide wrong credentials the software just carries on!

有我丢失的东西,我查了一下EWS MSDN的东西,这表明你如何连接到交换,但没有有关验证凭据!

Is there something I'm missing, I've checked the MSDN stuff about EWS which shows you how to connect to exchange but nothing about validating credentials!

下面是我现在有连接的代码。

Below is the code I currently have to connect.

public void connect(string Email, string Password)
    {
        try
        {            
            _useremail = Email;
            _userpass = Password;

            // Define the credentials to use.
            var credentials = new WebCredentials(_useremail, _userpass);

            _ExchangeServer = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
            _ExchangeServer.Credentials = credentials;
            _ExchangeServer.Url = new Uri(_ExchangeEWSURL);
            _ExchangeServer.Timeout = 60;
            _ExchangeServer.KeepAlive = true;
            _ExchangeConnected = true;
        }
        catch (Exception ex)
        {
            _ExchangeConnected = false;
            throw ex;
        }
    }



你可以看到,目前我只设置一个布尔值为true在类。任何想法?

as you can see at present I just set a bool value to true in the class. Any ideas?

推荐答案

为了检查给定的证书是否有效,你必须查询资源您所期望的用户访问到(日历,收件箱,联系人等。的)。没有明确的登录方式 - 通过的 .exchange.webservices.data.exchangeservice.finditems%28V = EXCHG.80%29.aspx> FindItems ,的 FindFolders FindAppointments 等。的)。

In order to check whether the given credentials are valid, you must query resources you expect the user to have access to (calendar, inbox, contacts, etc.). There is no explicit login method - the authentication occurs implicitly when you request user resources (via FindItems, FindFolders, FindAppointments, etc.).

这篇关于远程检查交换的凭证,检查用户登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆