• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ICredentialStore类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ICredentialStore的典型用法代码示例。如果您正苦于以下问题:C# ICredentialStore类的具体用法?C# ICredentialStore怎么用?C# ICredentialStore使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ICredentialStore类属于命名空间,在下文中一共展示了ICredentialStore类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
 }
开发者ID:Benrnz,项目名称:BudgetAnalyser,代码行数:7,代码来源:EncryptedLocalDiskReaderWriter.cs


示例2: UploadCommand

 public UploadCommand(IMessageObserver observer, IGoulRequestHandler gRequestHandler, ICredentialStore credentialStore, IRefreshTokenStore refreshStore)
 {
     mObserver = observer;
       mHandler = gRequestHandler;
       mCredentialStore = credentialStore;
       mRefreshStore = refreshStore;
 }
开发者ID:asipe,项目名称:Goul,代码行数:7,代码来源:UploadCommand.cs


示例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;
        }
开发者ID:dongruiqing,项目名称:Git-Credential-Manager-for-Windows,代码行数:13,代码来源:BasicAuthentication.cs


示例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;
        }
开发者ID:dongruiqing,项目名称:Git-Credential-Manager-for-Windows,代码行数:30,代码来源:GitHubAuthentication.cs


示例5: AuthorizeCommand

 public AuthorizeCommand(IMessageObserver observer, IRefreshTokenStore refreshStorage, ICredentialStore credentialStore, IGoulRequestHandler handler)
 {
     mObserver = observer;
       mRefreshStorage = refreshStorage;
       mCredStore = credentialStore;
       mHandler = handler;
 }
开发者ID:asipe,项目名称:Goul,代码行数:7,代码来源:AuthorizeCommand.cs


示例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();
         }
     }
 }
开发者ID:stevenh77,项目名称:ItineraryHunter-Win8,代码行数:25,代码来源:AccountService.cs


示例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;
        }
开发者ID:haikyuu,项目名称:Git-Credential-Manager-for-Windows,代码行数:37,代码来源:GitHubAuthentication.cs


示例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();
        }
开发者ID:Benrnz,项目名称:BudgetAnalyser,代码行数:29,代码来源:ApplicationDatabaseService.cs


示例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)
 { }
开发者ID:Microsoft,项目名称:Git-Credential-Manager-for-Windows,代码行数:11,代码来源:VstsAadAuthentication.cs


示例10: SecretCache

        internal SecretCache(ICredentialStore credentialStore)
        {
            if (credentialStore == null)
                throw new ArgumentNullException(nameof(credentialStore));

            _namespace = credentialStore.Namespace;
            _getTargetName = credentialStore.UriNameConversion;
        }
开发者ID:Microsoft,项目名称:Git-Credential-Manager-for-Windows,代码行数:8,代码来源:SecretCache.cs


示例11: GetAuthorizationUrlCommand

 public GetAuthorizationUrlCommand(IMessageObserver observer,
                               ICredentialStore credentialStore,
                               IGoulRequestHandler handler)
 {
     mObserver = observer;
       mCredentialStore = credentialStore;
       mHandler = handler;
 }
开发者ID:asipe,项目名称:Goul,代码行数:8,代码来源:GetAuthorizationUrlCommand.cs


示例12: CredentialService

        public CredentialService(ICredentialStore store, IMailSender mailSender,
			IContentTypeManager contentTypeManager,
			IPersister persister)
        {
            _store = store;
            _mailSender = mailSender;
            _contentTypeManager = contentTypeManager;
            _persister = persister;
        }
开发者ID:dpawatts,项目名称:zeus,代码行数:9,代码来源:CredentialService.cs


示例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)
 { }
开发者ID:dongruiqing,项目名称:Git-Credential-Manager-for-Windows,代码行数:13,代码来源:VsoAadAuthentication.cs


示例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();
 }
开发者ID:dongruiqing,项目名称:Git-Credential-Manager-for-Windows,代码行数:16,代码来源:BaseVsoAuthentication.cs


示例15: VstsMsaAuthentication

 public VstsMsaAuthentication(
     VstsTokenScope tokenScope,
     ICredentialStore personalAccessTokenStore,
     ITokenStore adaRefreshTokenStore = null)
     : base(tokenScope,
            personalAccessTokenStore,
            adaRefreshTokenStore)
 {
     this.VstsAuthority = new VstsAzureAuthority(DefaultAuthorityHost);
 }
开发者ID:digitalinfinity,项目名称:Git-Credential-Manager-for-Windows,代码行数:10,代码来源:VstsMsaAuthentication.cs


示例16: VstsMsaAuthentication

 /// <summary>
 /// Test constructor which allows for using fake credential stores
 /// </summary>
 /// <param name="personalAccessTokenStore"></param>
 /// <param name="adaRefreshTokenStore"></param>
 /// <param name="vstsIdeTokenCache"></param>
 /// <param name="liveAuthority"></param>
 internal VstsMsaAuthentication(
     ICredentialStore personalAccessTokenStore,
     ITokenStore adaRefreshTokenStore,
     ITokenStore vstsIdeTokenCache,
     IVstsAuthority liveAuthority)
     : base(personalAccessTokenStore,
            adaRefreshTokenStore,
            vstsIdeTokenCache,
            liveAuthority)
 { }
开发者ID:Austin503,项目名称:Git-Credential-Manager-for-Windows,代码行数:17,代码来源:VstsMsaAuthentication.cs


示例17: SecretStore

        /// <summary>
        /// Creates a new <see cref="SecretStore"/> backed by the operating system keychain /
        /// secrets vault.
        /// </summary>
        /// <param name="namespace">The namespace of the secrets written and read by this store.</param>
        /// <param name="credentialCache">
        /// (optional) Write-through, read-first cache. Default cache is used if a custom cache is
        /// not provided.
        /// </param>
        /// <param name="tokenCache">
        /// (optional) Write-through, read-first cache. Default cache is used if a custom cache is
        /// not provided.
        /// </param>
        public SecretStore(string @namespace, ICredentialStore credentialCache = null, ITokenStore tokenCache = null, Secret.UriNameConversion getTargetName = null)
        {
            if (String.IsNullOrWhiteSpace(@namespace) || @namespace.IndexOfAny(IllegalCharacters) != -1)
                throw new ArgumentNullException("prefix", "The `prefix` parameter is null or invalid.");

            _getTargetName = getTargetName ?? Secret.UriToSimpleName;

            _namespace = @namespace;
            _credentialCache = credentialCache ?? new SecretCache(@namespace, _getTargetName);
            _tokenCache = tokenCache ?? new SecretCache(@namespace, _getTargetName);
        }
开发者ID:colhountech,项目名称:Git-Credential-Manager-for-Windows,代码行数:24,代码来源:SecretStore.cs


示例18: GithubAuthentication

        /// <summary>
        /// 
        /// </summary>
        /// <param name="tokenScope"></param>
        /// <param name="personalAccessTokenStore"></param>
        public GithubAuthentication(GithubTokenScope tokenScope, ICredentialStore personalAccessTokenStore)
        {
            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.");

            TokenScope = tokenScope;

            PersonalAccessTokenStore = personalAccessTokenStore;
            GithubAuthority = new GithubAuthority();
        }
开发者ID:haikyuu,项目名称:Git-Credential-Manager-for-Windows,代码行数:17,代码来源:GitHubAuthentication.cs


示例19: BaseVstsAuthentication

        protected BaseVstsAuthentication(VstsTokenScope tokenScope, ICredentialStore personalAccessTokenStore)
        {
            if (ReferenceEquals(tokenScope, null))
                throw new ArgumentNullException(nameof(TokenScope));
            if (ReferenceEquals(personalAccessTokenStore, null))
                throw new ArgumentNullException(nameof(personalAccessTokenStore));

            this.ClientId = DefaultClientId;
            this.Resource = DefaultResource;
            this.TokenScope = tokenScope;
            this.PersonalAccessTokenStore = personalAccessTokenStore;
            this.VstsAuthority = new VstsAzureAuthority();
        }
开发者ID:Microsoft,项目名称:Git-Credential-Manager-for-Windows,代码行数:13,代码来源:BaseVstsAuthentication.cs


示例20: SecretStore

        /// <summary>
        /// Creates a new <see cref="SecretStore"/> backed by the operating system keychain /
        /// secrets vault.
        /// </summary>
        /// <param name="namespace">The namespace of the secrets written and read by this store.</param>
        /// <param name="credentialCache">
        /// (optional) Write-through, read-first cache. Default cache is used if a custom cache is
        /// not provided.
        /// </param>
        /// <param name="tokenCache">
        /// (optional) Write-through, read-first cache. Default cache is used if a custom cache is
        /// not provided.
        /// </param>
        public SecretStore(string @namespace, ICredentialStore credentialCache = null, ITokenStore tokenCache = null, Secret.UriNameConversion getTargetName = null)
        {
            if (String.IsNullOrWhiteSpace(@namespace))
                throw new ArgumentNullException(nameof(@namespace));
            if (@namespace.IndexOfAny(IllegalCharacters) != -1)
                throw new ArgumentException(nameof(@namespace));

            _getTargetName = getTargetName ?? Secret.UriToName;

            _namespace = @namespace;
            _credentialCache = credentialCache ?? new SecretCache(@namespace, _getTargetName);
            _tokenCache = tokenCache ?? new SecretCache(@namespace, _getTargetName);
        }
开发者ID:Microsoft,项目名称:Git-Credential-Manager-for-Windows,代码行数:26,代码来源:SecretStore.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ICredentials类代码示例发布时间:2022-05-24
下一篇:
C# ICreaturesInBattle类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap