本文整理汇总了C#中ICredentialStore类的典型用法代码示例。如果您正苦于以下问题:C# ICredentialStore类的具体用法?C# ICredentialStore怎么用?C# ICredentialStore使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ICredentialStore类属于命名空间,在下文中一共展示了ICredentialStore类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EncryptedLocalDiskReaderWriter
public EncryptedLocalDiskReaderWriter([NotNull] IFileEncryptor fileEncryptor, [NotNull] ICredentialStore credentialStore)
{
if (fileEncryptor == null) throw new ArgumentNullException(nameof(fileEncryptor));
if (credentialStore == null) throw new ArgumentNullException(nameof(credentialStore));
this.fileEncryptor = fileEncryptor;
this.credentialStore = credentialStore;
}
示例2: UploadCommand
public UploadCommand(IMessageObserver observer, IGoulRequestHandler gRequestHandler, ICredentialStore credentialStore, IRefreshTokenStore refreshStore)
{
mObserver = observer;
mHandler = gRequestHandler;
mCredentialStore = credentialStore;
mRefreshStore = refreshStore;
}
示例3: BasicAuthentication
/// <summary>
/// Creates a new <see cref="BasicAuthentication"/> object with an underlying credential store.
/// </summary>
/// <param name="credentialStore">
/// The <see cref="ICredentialStore"/> to delegate to.
/// </param>
public BasicAuthentication(ICredentialStore credentialStore)
{
if (credentialStore == null)
throw new ArgumentNullException("credentialStore", "The `credentialStore` parameter is null or invalid.");
this.CredentialStore = credentialStore;
}
示例4: GithubAuthentication
/// <summary>
///
/// </summary>
/// <param name="tokenScope"></param>
/// <param name="personalAccessTokenStore"></param>
public GithubAuthentication(
GithubTokenScope tokenScope,
ICredentialStore personalAccessTokenStore,
AcquireCredentialsDelegate acquireCredentialsCallback,
AcquireAuthenticationCodeDelegate acquireAuthenticationCodeCallback,
AuthenticationResultDelegate authenticationResultCallback)
{
if (tokenScope == null)
throw new ArgumentNullException("tokenScope", "The parameter `tokenScope` is null or invalid.");
if (personalAccessTokenStore == null)
throw new ArgumentNullException("personalAccessTokenStore", "The parameter `personalAccessTokenStore` is null or invalid.");
if (acquireCredentialsCallback == null)
throw new ArgumentNullException("acquireCredentialsCallback", "The parameter `acquireCredentialsCallback` is null or invalid.");
if (acquireAuthenticationCodeCallback == null)
throw new ArgumentNullException("acquireAuthenticationCodeCallback", "The parameter `acquireAuthenticationCodeCallback` is null or invalid.");
TokenScope = tokenScope;
PersonalAccessTokenStore = personalAccessTokenStore;
GithubAuthority = new GithubAuthority();
AcquireCredentialsCallback = acquireCredentialsCallback;
AcquireAuthenticationCodeCallback = acquireAuthenticationCodeCallback;
AuthenticationResultCallback = authenticationResultCallback;
}
示例5: AuthorizeCommand
public AuthorizeCommand(IMessageObserver observer, IRefreshTokenStore refreshStorage, ICredentialStore credentialStore, IGoulRequestHandler handler)
{
mObserver = observer;
mRefreshStorage = refreshStorage;
mCredStore = credentialStore;
mHandler = handler;
}
示例6: AccountService
public AccountService(IIdentityService identityService, ISuspensionManagerState suspensionManagerState, ICredentialStore credentialStore)
{
_identityService = identityService;
_suspensionManagerState = suspensionManagerState;
_credentialStore = credentialStore;
if (_suspensionManagerState != null)
{
if (_suspensionManagerState.SessionState.ContainsKey(ServerCookieHeaderKey))
{
_serverCookieHeader = _suspensionManagerState.SessionState[ServerCookieHeaderKey] as string;
}
if (_suspensionManagerState.SessionState.ContainsKey(SignedInUserKey))
{
_signedInUser = _suspensionManagerState.SessionState[SignedInUserKey] as UserInfo;
}
if (_suspensionManagerState.SessionState.ContainsKey(UserNameKey))
{
_userName = _suspensionManagerState.SessionState[UserNameKey].ToString();
}
if (_suspensionManagerState.SessionState.ContainsKey(PasswordKey))
{
_password = _suspensionManagerState.SessionState[PasswordKey].ToString();
}
}
}
示例7: GetAuthentication
/// <summary>
/// Gets a configured authentication object for 'github.com'.
/// </summary>
/// <param name="targetUri">The uniform resource indicator of the resource which requires
/// authentication.</param>
/// <param name="tokenScope">The desired scope of any personal access tokens aqcuired.</param>
/// <param name="personalAccessTokenStore">A secure secret store for any personal access
/// tokens acquired.</param>
/// <param name="authentication">(out) The authenitcation object if successful.</param>
/// <returns>True if success; otherwise false.</returns>
public static bool GetAuthentication(
Uri targetUri,
GithubTokenScope tokenScope,
ICredentialStore personalAccessTokenStore,
out BaseAuthentication authentication)
{
const string GitHubBaseUrlHost = "github.com";
BaseSecureStore.ValidateTargetUri(targetUri);
if (personalAccessTokenStore == null)
throw new ArgumentNullException("personalAccessTokenStore", "The `personalAccessTokenStore` is null or invalid.");
Trace.WriteLine("GithubAuthentication::GetAuthentication");
if (targetUri.DnsSafeHost.EndsWith(GitHubBaseUrlHost, StringComparison.OrdinalIgnoreCase))
{
authentication = new GithubAuthentication(tokenScope, personalAccessTokenStore);
Trace.WriteLine(" authentication for GitHub created");
}
else
{
authentication = null;
Trace.WriteLine(" not github.com, authentication creation aborted");
}
return authentication != null;
}
示例8: ApplicationDatabaseService
public ApplicationDatabaseService(
[NotNull] IApplicationDatabaseRepository applicationRepository,
[NotNull] IEnumerable<ISupportsModelPersistence> databaseDependents,
[NotNull] MonitorableDependencies monitorableDependencies,
[NotNull] ICredentialStore credentialStore,
[NotNull] ILogger logger)
{
if (applicationRepository == null)
{
throw new ArgumentNullException(nameof(applicationRepository));
}
if (databaseDependents == null)
{
throw new ArgumentNullException(nameof(databaseDependents));
}
if (monitorableDependencies == null) throw new ArgumentNullException(nameof(monitorableDependencies));
if (credentialStore == null) throw new ArgumentNullException(nameof(credentialStore));
if (logger == null) throw new ArgumentNullException(nameof(logger));
this.applicationRepository = applicationRepository;
this.monitorableDependencies = monitorableDependencies;
this.credentialStore = credentialStore;
this.logger = logger;
this.databaseDependents = databaseDependents.OrderBy(d => d.LoadSequence).ToList();
this.monitorableDependencies.NotifyOfDependencyChange<IApplicationDatabaseService>(this);
InitialiseDirtyDataTable();
}
示例9: VstsAadAuthentication
/// <summary>
/// Test constructor which allows for using fake credential stores
/// </summary>
internal VstsAadAuthentication(
ICredentialStore personalAccessTokenStore,
ITokenStore vstsIdeTokenCache,
IVstsAuthority vstsAuthority)
: base(personalAccessTokenStore,
vstsIdeTokenCache,
vstsAuthority)
{ }
示例10: SecretCache
internal SecretCache(ICredentialStore credentialStore)
{
if (credentialStore == null)
throw new ArgumentNullException(nameof(credentialStore));
_namespace = credentialStore.Namespace;
_getTargetName = credentialStore.UriNameConversion;
}
示例11: GetAuthorizationUrlCommand
public GetAuthorizationUrlCommand(IMessageObserver observer,
ICredentialStore credentialStore,
IGoulRequestHandler handler)
{
mObserver = observer;
mCredentialStore = credentialStore;
mHandler = handler;
}
示例12: CredentialService
public CredentialService(ICredentialStore store, IMailSender mailSender,
IContentTypeManager contentTypeManager,
IPersister persister)
{
_store = store;
_mailSender = mailSender;
_contentTypeManager = contentTypeManager;
_persister = persister;
}
示例13: VsoAadAuthentication
/// <summary>
/// Test constructor which allows for using fake credential stores
/// </summary>
internal VsoAadAuthentication(
ICredentialStore personalAccessTokenStore,
ITokenStore adaRefreshTokenStore,
ITokenStore vsoIdeTokenCache,
IVsoAuthority vsoAuthority)
: base(personalAccessTokenStore,
adaRefreshTokenStore,
vsoIdeTokenCache,
vsoAuthority)
{ }
示例14: BaseVsoAuthentication
/// <summary>
/// Invoked by a derived classes implementation. Allows custom back-end implementations to be used.
/// </summary>
/// <param name="tokenScope">The desired scope of the acquired personal access token(s).</param>
/// <param name="personalAccessTokenStore">The secret store for acquired personal access token(s).</param>
/// <param name="adaRefreshTokenStore">The secret store for acquired Azure refresh token(s).</param>
protected BaseVsoAuthentication(
VsoTokenScope tokenScope,
ICredentialStore personalAccessTokenStore,
ITokenStore adaRefreshTokenStore = null)
: this(tokenScope, personalAccessTokenStore)
{
this.AdaRefreshTokenStore = adaRefreshTokenStore ?? this.AdaRefreshTokenStore;
this.VsoAdalTokenCache = new VsoAdalTokenCache();
this.VsoIdeTokenCache = new TokenRegistry();
}
示例15: VstsMsaAuthentication
public VstsMsaAuthentication(
VstsTokenScope tokenScope,
ICredentialStore personalAccessTokenStore,
ITokenStore adaRefreshTokenStore = null)
: base(tokenScope,
personalAccessTokenStore,
adaRefreshTokenStore)
{
this.VstsAuthority = new VstsAzureAuthority(DefaultAuthorityHost);
}