/// <summary> /// Creates a new authentication /// </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 acquired.</param> /// <param name="personalAccessTokenStore"> /// A secure secret store for any personal access tokens acquired. /// </param> public Authentication( RuntimeContext context, TargetUri targetUri, TokenScope tokenScope, ICredentialStore personalAccessTokenStore, AcquireCredentialsDelegate acquireCredentialsCallback, AcquireAuthenticationCodeDelegate acquireAuthenticationCodeCallback, AuthenticationResultDelegate authenticationResultCallback) : base(context) { TokenScope = tokenScope ?? throw new ArgumentNullException("tokenScope", "The parameter `tokenScope` is null or invalid."); PersonalAccessTokenStore = personalAccessTokenStore ?? throw new ArgumentNullException("personalAccessTokenStore", "The parameter `personalAccessTokenStore` is null or invalid."); AcquireCredentialsCallback = acquireCredentialsCallback ?? throw new ArgumentNullException("acquireCredentialsCallback", "The parameter `acquireCredentialsCallback` is null or invalid."); AcquireAuthenticationCodeCallback = acquireAuthenticationCodeCallback ?? throw new ArgumentNullException("acquireAuthenticationCodeCallback", "The parameter `acquireAuthenticationCodeCallback` is null or invalid."); Authority = new Authority(context, NormalizeUri(targetUri)); AuthenticationResultCallback = authenticationResultCallback; }