/// <summary>
 /// Non-interactive request to acquire a security token for the signed-in user in Windows,
 /// via Integrated Windows Authentication. See https://aka.ms/msal-net-iwa.
 /// The account used in this overrides is pulled from the operating system as the current user principal name.
 /// </summary>
 /// <param name="scopes">Scopes requested to access a protected API</param>
 /// <returns>A builder enabling you to add optional parameters before executing the token request</returns>
 /// <remarks>
 /// You can also pass optional parameters by calling:
 /// <see cref="AcquireTokenByIntegratedWindowsAuthParameterBuilder.WithUsername(string)"/> to pass the identifier
 /// of the user account for which to acquire a token with Integrated Windows authentication. This is generally in
 /// UserPrincipalName (UPN) format, e.g. [email protected]. This is normally not needed, but some Windows administrators
 /// set policies preventing applications from looking-up the signed-in user in Windows, and in that case the username
 /// needs to be passed.
 /// You can also chain with
 /// <see cref="AbstractAcquireTokenParameterBuilder{T}.WithExtraQueryParameters(Dictionary{string, string})"/> to pass
 /// additional query parameters to the STS, and one of the overrides of <see cref="AbstractAcquireTokenParameterBuilder{T}.WithAuthority(string, bool)"/>
 /// in order to override the default authority set at the application construction. Note that the overriding authority needs to be part
 /// of the known authorities added to the application construction.
 /// </remarks>
 public AcquireTokenByIntegratedWindowsAuthParameterBuilder AcquireTokenByIntegratedWindowsAuth(
     IEnumerable <string> scopes)
 {
     return(AcquireTokenByIntegratedWindowsAuthParameterBuilder.Create(
                ClientExecutorFactory.CreatePublicClientExecutor(this),
                scopes));
 }
 public AcquireTokenInteractiveParameterBuilder AcquireTokenInteractive(
     IEnumerable <string> scopes)
 {
     return(AcquireTokenInteractiveParameterBuilder
            .Create(ClientExecutorFactory.CreatePublicClientExecutor(this), scopes)
            .WithParentActivityOrWindowFunc(ServiceBundle.Config.ParentActivityOrWindowFunc));
 }
#pragma warning restore CS1574 // XML comment has cref attribute that could not be resolved

        /// <summary>
        /// Acquires a security token on a device without a web browser, by letting the user authenticate on
        /// another device. This is done in two steps:
        /// <list type="bullet">
        /// <item><description>The method first acquires a device code from the authority and returns it to the caller via
        /// the <paramref name="deviceCodeResultCallback"/>. This callback takes care of interacting with the user
        /// to direct them to authenticate (to a specific URL, with a code)</description></item>
        /// <item><description>The method then proceeds to poll for the security
        /// token which is granted upon successful login by the user based on the device code information</description></item>
        /// </list>
        /// See https://aka.ms/msal-device-code-flow.
        /// </summary>
        /// <param name="scopes">Scopes requested to access a protected API</param>
        /// <param name="deviceCodeResultCallback">Callback containing information to show the user about how to authenticate and enter the device code.</param>
        /// <returns>A builder enabling you to add optional parameters before executing the token request</returns>
        /// <remarks>
        /// You can also pass optional parameters by calling:
        /// <see cref="AbstractAcquireTokenParameterBuilder{T}.WithExtraQueryParameters(Dictionary{string, string})"/> to pass
        /// additional query parameters to the STS, and one of the overrides of <see cref="AbstractAcquireTokenParameterBuilder{T}.WithAuthority(string, bool)"/>
        /// in order to override the default authority set at the application construction. Note that the overriding authority needs to be part
        /// of the known authorities added to the application construction.
        /// </remarks>
        public AcquireTokenWithDeviceCodeParameterBuilder AcquireTokenWithDeviceCode(
            IEnumerable <string> scopes,
            Func <DeviceCodeResult, Task> deviceCodeResultCallback)
        {
            return(AcquireTokenWithDeviceCodeParameterBuilder.Create(
                       ClientExecutorFactory.CreatePublicClientExecutor(this),
                       scopes,
                       deviceCodeResultCallback));
        }
 /// <summary>
 /// Non-interactive request to acquire a security token from the authority, via Username/Password Authentication.
 /// See https://aka.ms/msal-net-up for details.
 /// </summary>
 /// <param name="scopes">Scopes requested to access a protected API</param>
 /// <param name="username">Identifier of the user application requests token on behalf.
 /// Generally in UserPrincipalName (UPN) format, e.g. <c>[email protected]</c></param>
 /// <param name="password">User password as a secure string.</param>
 /// <returns>A builder enabling you to add optional parameters before executing the token request</returns>
 /// <remarks>You can also pass optional parameters by chaining the builder with:
 /// <see cref="AbstractAcquireTokenParameterBuilder{T}.WithExtraQueryParameters(Dictionary{string, string})"/> to pass
 /// additional query parameters to the STS, and one of the overrides of <see cref="AbstractAcquireTokenParameterBuilder{T}.WithAuthority(string, bool)"/>
 /// in order to override the default authority set at the application construction. Note that the overriding authority needs to be part
 /// of the known authorities added to the application construction.
 /// </remarks>
 public AcquireTokenByUsernamePasswordParameterBuilder AcquireTokenByUsernamePassword(
     IEnumerable <string> scopes,
     string username,
     SecureString password)
 {
     return(AcquireTokenByUsernamePasswordParameterBuilder.Create(
                ClientExecutorFactory.CreatePublicClientExecutor(this),
                scopes,
                username,
                password));
 }