本文整理汇总了C#中Authenticator类的典型用法代码示例。如果您正苦于以下问题:C# Authenticator类的具体用法?C# Authenticator怎么用?C# Authenticator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Authenticator类属于命名空间,在下文中一共展示了Authenticator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: PSAuthLoginProof
public PSAuthLoginProof(Authenticator authenticator)
: base(LoginOpcodes.AUTH_LOGIN_PROOF)
{
Write((byte)AccountStatus.Ok);
Write(authenticator.SRP6.M2);
this.WriteNullByte(4);
}
开发者ID:Refuge89,项目名称:Vanilla,代码行数:7,代码来源:PSAuthLoginProof.cs
示例2: 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
示例3: 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
示例4: Setup
public void Setup()
{
var driveAuthenticator = new Authenticator();
driveAuthenticator.Authenticate("test");
this.googleDriveServiceProvider = new GoogleDriveServiceProvider(driveAuthenticator);
this.testee = new FileDownloader(this.googleDriveServiceProvider);
}
开发者ID:andrinbuerli,项目名称:webdrivemanager,代码行数:7,代码来源:DriveFileDownloaderTest.cs
示例5: Setup
public void Setup()
{
var authenticator = new Authenticator();
authenticator.Authenticate("test");
var serviceProvider = new GoogleDriveServiceProvider(authenticator);
this.testee = new FolderSynchronizer(new FilesGetter(serviceProvider), new FileDownloader(serviceProvider));
}
开发者ID:andrinbuerli,项目名称:webdrivemanager,代码行数:7,代码来源:FolderSynchronizerTest.cs
示例6: 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
示例7: ClientInterface
public ClientInterface(IrcLoginCreds loginCreds, List<IrcComponent> auxComponents)
{
KillClient = false;
Client = new IrcClient();
Client.SendDelay = 200;
Client.ActiveChannelSyncing = true;
//Client.AutoRetry = true;
_loginCreds = loginCreds;
Client.CtcpVersion = "Pikatwo - Interactive chatbot with lifelike texture by zalzane.";
_authenticator = new Authenticator();
_components = auxComponents;
_components.Add(_authenticator);
_components.Add(new Reconnector());
foreach (var component in _components){
component.IrcInterface = this;
}
Client.OnChannelMessage += HandleCommands;
Client.OnQueryMessage += HandleCommands;
Client.OnRawMessage += ClientOnOnRawMessage;
_debugWriter = new StreamWriter("debugOut.txt", true);
_rawWriter = new StreamWriter("rawOut.txt", true);
}
开发者ID:bsamuels453,项目名称:Pikatwo,代码行数:27,代码来源:ClientInterface.cs
示例8: 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
示例9: 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
示例10: Authenticate_WhereDownstreamResultEmpty_ReturnsFalse
public async Task Authenticate_WhereDownstreamResultEmpty_ReturnsFalse()
{
// arrange
var proxy = new AuthenticatorProxyWithResult("");
authenticator = new Authenticator(proxy);
// act
var result = await authenticator.Authenticate("url");
Assert.IsFalse(result.IsSuccess);
}
开发者ID:shiftkey,项目名称:AppDotNet-Win8,代码行数:11,代码来源:AuthenticatorTests.cs
示例11: Authenticate_WhereDownstreamResultOccurs_ReturnsSuccess
public async Task Authenticate_WhereDownstreamResultOccurs_ReturnsSuccess()
{
// arrange
var proxy = new AuthenticatorProxyWithResult("foo");
authenticator = new Authenticator(proxy);
// act
var result = await authenticator.Authenticate("url");
Assert.IsTrue(result.IsSuccess);
}
开发者ID:shiftkey,项目名称:AppDotNet-Win8,代码行数:11,代码来源:AuthenticatorTests.cs
示例12: AsyncResumableUploadData
public AsyncResumableUploadData(AsyncDataHandler handler,
Authenticator authenticator,
AbstractEntry payload,
string httpMethod,
SendOrPostCallback callback,
object userData)
: base(null, null, userData, callback) {
this.DataHandler = handler;
this.authenticator = authenticator;
this.entry = payload;
this.HttpVerb = httpMethod;
}
开发者ID:jamesjbigler,项目名称:googleReaderShares2Blogger,代码行数:12,代码来源:resumableupload.cs
示例13: 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
示例14: 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
示例15: LoginLogic
private IEnumerator LoginLogic()
{
painel.GetComponent<LoadingPanelCreator>().CreateLoadingPanel();
Authenticator authenticator = new Authenticator()
.setUserName(username.text)
.setPassword(password.text)
.setLoginSuccesfullCallback(loginSuccesfull)
.setLoginFailCallback(loginFail);
yield return authenticator.makeLogin();
painel.GetComponent<LoadingPanelCreator>().DestroyLoadingPanel();
}
开发者ID:gabrielamboss,项目名称:Ulkoa,代码行数:14,代码来源:Login.cs
示例16: WebAuthenticator
public WebAuthenticator (Authenticator authenticator)
{
Shared = this;
this.Authenticator = authenticator;
MonitorAuthenticator ();
//
// Create the UI
//
Title = authenticator.Title;
if (authenticator.AllowsCancel) {
NavigationItem.LeftBarButtonItem = new UIBarButtonItem (
UIBarButtonSystemItem.Cancel,
delegate {
Cancel ();
});
}
var activityStyle = UIActivityIndicatorViewStyle.White;
if (UIDevice.CurrentDevice.CheckSystemVersion (7, 0))
activityStyle = UIActivityIndicatorViewStyle.Gray;
activity = new UIActivityIndicatorView (activityStyle);
var rightBarButtonItems = new List<UIBarButtonItem> {
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
new UIBarButtonItem (UIBarButtonSystemItem.Refresh, (s, e) => BeginLoadingInitialUrl ()),
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
new UIBarButtonItem (activity),
};
if(RightButtonItem != null)
rightBarButtonItems.Insert(0,RightButtonItem);
NavigationItem.RightBarButtonItems = rightBarButtonItems.ToArray();
webView = new UIWebView (View.Bounds) {
Delegate = new WebViewDelegate (this),
AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight,
};
View.AddSubview (webView);
View.BackgroundColor = UIColor.Black;
//
// Locate our initial URL
//
#pragma warning disable 4014
BeginLoadingInitialUrl ();
#pragma warning restore 4014
}
开发者ID:rob-derosa,项目名称:SimpleAuth,代码行数:48,代码来源:WebAuthenticator.cs
示例17: Main
static void Main(string[] args)
{
try
{
if (args.Length == 0)
{
AzureAccount azureAccount = new AzureAccount();
azureAccount.Type = AzureAccount.AccountType.User;
var environment = AzureEnvironment.PublicEnvironments["AzureCloud"];
var auth = new Authenticator(AzureRmProfileProvider.Instance.Profile);
auth.Login(azureAccount, environment);
}
else if (args.Length == 2)
{
var subcriptionId = args[0];
var authToken = args[1];
Authenticator.ShowIoTHubsInSubscription(subcriptionId, authToken).Wait();
}
else
{
Console.WriteLine("Usage:");
Console.WriteLine("MSAAuthenticator.exe");
Console.WriteLine(" Pop up a credentials gatheting windows and list all IoT Hubs under all subscriptions associated with the user");
Console.WriteLine("MSAAuthenticator.exe <subscription_id> <access_token>");
Console.WriteLine(" Lists IoT Hubs abd devices given subscription_id and access_token");
}
}
catch (Exception ex)
{
var aggr = ex as System.AggregateException;
if (aggr != null)
{
foreach (var inner in aggr.InnerExceptions)
{
Console.WriteLine("Exception: {0}", inner.Message);
}
}
else
{
Console.WriteLine("Exception: {0}", ex.Message);
}
}
}
开发者ID:ms-iot,项目名称:security,代码行数:46,代码来源:Program.cs
示例18: Synchronize_WhenFolderIsSynchronize_ThenStructureIsCorrect
public void Synchronize_WhenFolderIsSynchronize_ThenStructureIsCorrect()
{
// Arrange
var authenticator = new Authenticator();
authenticator.Authenticate("test");
var filesGetter = new FilesGetter(new GoogleDriveServiceProvider(authenticator));
var files = filesGetter.GetDriveFiles(GoogleDriveConstants.FolderMimeType).ToList();
// Act
string rootFolder = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "\\TestGoogle";
this.testee.SynchronizeFolder(
files[1],
rootFolder);
// Assert
Directory.Exists(rootFolder).Should().BeTrue();
Directory.GetDirectories(rootFolder).Length.Should().Be(1);
}
开发者ID:andrinbuerli,项目名称:webdrivemanager,代码行数:18,代码来源:FolderSynchronizerTest.cs
示例19: SaveLogic
private IEnumerator SaveLogic()
{
painel.GetComponent<LoadingPanelCreator>().CreateLoadingPanel();
Authenticator authenticator = new Authenticator()
.setUserName(username.text)
.setPassword(password.text)
.setEmail(email.text)
.setRegisterSuccesfullCallback(registerSuccesfull)
.setRegisterFailCallback(registerFail);
yield return authenticator.makeRegister();
if (succesfull)
{
yield return savePlayerData();
new LevelManager().LoadLevel(SceneBook.LOADING_NAME);
}
painel.GetComponent<LoadingPanelCreator>().DestroyLoadingPanel();
}
开发者ID:gabrielamboss,项目名称:Ulkoa,代码行数:21,代码来源:Register.cs
示例20: PrepareRequest
private HttpWebRequest PrepareRequest(Uri target,
Authenticator authentication,
string slug,
string contentType,
long contentLength,
string httpMethod) {
HttpWebRequest request = authentication.CreateHttpWebRequest(httpMethod, target);
request.Headers.Add(GDataRequestFactory.SlugHeader + ": " + slug);
request.Headers.Add(GDataRequestFactory.ContentOverrideHeader + ": " + contentType);
if (contentLength != -1) {
request.Headers.Add(GDataRequestFactory.ContentLengthOverrideHeader + ": " + contentLength);
}
return request;
}
开发者ID:jamesjbigler,项目名称:googleReaderShares2Blogger,代码行数:15,代码来源:resumableupload.cs
注:本文中的Authenticator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论