# Use Auth0 with Excel addin

**URL:** <https://community.auth0.com/t/use-auth0-with-excel-addin/121519>\
**Category:** Get Help\
**Tags:** custom-database-connections, connections\
**Created:** [November 23, 2023, 10:18am UTC](https://community.auth0.com/t/use-auth0-with-excel-addin/121519 "2023-11-23T10:18:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![daan1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@daan1](https://community.auth0.com/u/daan1)\
**Post date:** [November 23, 2023, 10:18am UTC](https://community.auth0.com/t/use-auth0-with-excel-addin/121519/1 "2023-11-23T10:18:48Z")

</div>

Hello, i am building an Excel add in (local with Visual Studio in C#). In that add in i have a loginform. I am new to Auth0 and also just starting with C#. I can’t get a connection with Auth0, if I push the button in Excel on the loginform I got an error: De aanvraag is afgebroken: Kan geen beveiligd SSL/TLS-kanaal maken." (Could not establish secure channel for SSL/TLS with authority). Can please anyone help me? I use the following code:  
public partial class LoginForm : Form  
{  
private AuthenticationApiClient client;  
public LoginForm()  
{  
InitializeComponent();

```
        client = new AuthenticationApiClient(
        new Uri("https://{domain}.auth0.com" )
        );

    }
    private async void btnLogin_Click(object sender, EventArgs e)
    {
        
        var request = new ResourceOwnerTokenRequest
        {
            ClientId = "{myclientid}",
            ClientSecret = "{myclientsecret}",
            Scope = "openid profile email",
            Realm = "Username-Password-Authentication", // Use the appropriate connection name
            Username = txtUsername.Text,
            Password = txtPassword.Text
        };
        
        //try
        {
            var response = await client.GetTokenAsync(request);

            if (response != null && !string.IsNullOrEmpty(response.AccessToken))
            {
                MessageBox.Show("Login successful!");
                // Proceed with your application after successful authentication
            }
            else
            {
                MessageBox.Show("Login failed.");
            }
        }
        //catch (Exception ex)
        //{
        // MessageBox.Show($"Login error: {ex.Message}");
        //}
    }

```

…other code.

I really appreciate if anyone can help me.

---

<div class="post-metadata">

**Author:** ![daan1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@daan1](https://community.auth0.com/u/daan1)\
**Post date:** [November 25, 2023, 8:09pm UTC](https://community.auth0.com/t/use-auth0-with-excel-addin/121519/2 "2023-11-25T20:09:19Z")

</div>

solved it by adding  
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [December 9, 2023, 8:09pm UTC](https://community.auth0.com/t/use-auth0-with-excel-addin/121519/3 "2023-12-09T20:09:53Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
