当前位置: 首页>>代码示例>>C#>>正文


C# Authenticator.AuthenticateAsync方法代码示例

本文整理汇总了C#中Authenticator.AuthenticateAsync方法的典型用法代码示例。如果您正苦于以下问题:C# Authenticator.AuthenticateAsync方法的具体用法?C# Authenticator.AuthenticateAsync怎么用?C# Authenticator.AuthenticateAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Authenticator的用法示例。


在下文中一共展示了Authenticator.AuthenticateAsync方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetClientInstance

        public static async Task<ExchangeClient> GetClientInstance()
        {
            Authenticator authenticator = new Authenticator();
            var authInfo = await authenticator.AuthenticateAsync(ExchangeResourceId);

            return new ExchangeClient(new Uri(ExchangeServiceRoot), authInfo.GetAccessToken);
        }
开发者ID:khoingo,项目名称:KhoiRepository,代码行数:7,代码来源:Office365Authenticator.cs

示例2: EnsureClientCreated

        private static async Task<ExchangeClient> EnsureClientCreated()
        {
            Authenticator authenticator = new Authenticator();
            var authInfo = await authenticator.AuthenticateAsync(ExchangeResourceId);

            return new ExchangeClient(new Uri(ExchangeServiceRoot), authInfo.GetAccessToken);
        }
开发者ID:khoingo,项目名称:KhoiRepository,代码行数:7,代码来源:CalendarApiSample.cs

示例3: EnsureClientCreated

        public static async Task<AadGraphClient> EnsureClientCreated(Context context)
        {
            Authenticator authenticator = new Authenticator(context);
            var authInfo = await authenticator.AuthenticateAsync(AadGraphResource);

            return new AadGraphClient(new Uri(AadGraphResource + authInfo.IdToken.TenantId), authInfo.GetAccessToken);
        }
开发者ID:modulexcite,项目名称:TrainingContent,代码行数:7,代码来源:ActiveDirectoryApiSample.cs

示例4: EnsureClientCreated

        public static async Task<SharePointClient> EnsureClientCreated(UIViewController context)
        {
            Authenticator authenticator = new Authenticator(context);
            var authInfo = await authenticator.AuthenticateAsync(SharePointResourceId, ServiceIdentifierKind.Resource);

            // Create the SharePoint client proxy:
            return new SharePointClient(new Uri(SharePointServiceRoot), authInfo.GetAccessToken);
        }
开发者ID:bbs14438,项目名称:MyShuttle.biz,代码行数:8,代码来源:InvoiceService.cs

示例5: EnsureClientCreated

        private static async Task<SharePointClient> EnsureClientCreated()
        {
            Authenticator authenticator = new Authenticator();
            var authInfo = await authenticator.AuthenticateAsync(MyFilesCapability, ServiceIdentifierKind.Capability);

            // Create the MyFiles client proxy:
            return new SharePointClient(authInfo.ServiceUri, authInfo.GetAccessToken);
        }
开发者ID:khoingo,项目名称:KhoiRepository,代码行数:8,代码来源:MyFilesApiSample.cs

示例6: EnsureExchangeClient

        public async Task<ExchangeClient> EnsureExchangeClient()
        {
            if (_exchangeClient != null)
                return _exchangeClient;

            var authenticator = new Authenticator();
            _authenticationInfo = await authenticator.AuthenticateAsync(ExchangeResourceId);

            _exchangeClient = new ExchangeClient(new Uri(ExchangeServiceRoot), _authenticationInfo.GetAccessToken);
            _isAuthenticated = true;
            return _exchangeClient;
        }
开发者ID:J0rgeSerran0,项目名称:PoC-Office365.API.Contacts,代码行数:12,代码来源:Office365Contact.cs

示例7: EnsureClientCreated

 public static async Task EnsureClientCreated(Context context) {
   
   Authenticator authenticator = new Authenticator(context);
   var authInfo = await authenticator.AuthenticateAsync(ExchangeResourceId);
   
   _strUserId = authInfo.IdToken.UPN;
   _exchangeClient = new ExchangeClient(new Uri(ExchangeServiceRoot), authInfo.GetAccessToken);
   
   var adAuthInfo = await authInfo.ReauthenticateAsync(AdServiceResourceId);
   _adClient = new AadGraphClient(new Uri("https://graph.windows.net/" + authInfo.IdToken.TenantId), 
                                  adAuthInfo.GetAccessToken);
 }
开发者ID:chrissimusokwe,项目名称:TrainingContent,代码行数:12,代码来源:Office365Service.cs

示例8: EnsureClientCreated

 public static async Task EnsureClientCreated(Context context) {
   Authenticator authenticator = new Authenticator(context);
   var authInfo = await authenticator.AuthenticateAsync(ExchangeResourceId);
   userId = authInfo.IdToken.UPN;
   exchangeClient = new ExchangeClient(new Uri(ExchangeServiceRoot), authInfo.GetAccessToken);
 }
开发者ID:modulexcite,项目名称:TrainingContent,代码行数:6,代码来源:Office365Service.cs


注:本文中的Authenticator.AuthenticateAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。