本文整理匯總了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}