# Sign in with a console application

**URL:** <https://devforum.okta.com/t/sign-in-with-a-console-application/16368>\
**Category:** Questions\
**Tags:** dotnet\
**Created:** [September 28, 2021, 7:54pm UTC](https://devforum.okta.com/t/sign-in-with-a-console-application/16368 "2021-09-28T19:54:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shawn565](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@Shawn565](https://devforum.okta.com/u/Shawn565)\
**Post date:** [September 28, 2021, 7:54pm UTC](https://devforum.okta.com/t/sign-in-with-a-console-application/16368/1 "2021-09-28T19:54:44Z")

</div>

I’m currently working on a c# console application that will be used to authenticate a user.

This application will be triggered by the command line and I would like the Okta page to sign in to appear.

How would I go about making this possible?

With Microsoft, you can call a method called like " AcquireTokenInteractive" and then a webpage dialog would appear and user can sign in. Is there something similar to that in Okta?

---

<div class="post-metadata">

**Author:** ![okra-okta](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/okra-okta/32/2838_2.png) [@okra-okta](https://devforum.okta.com/u/okra-okta)\
**Post date:** [September 28, 2021, 10:37pm UTC](https://devforum.okta.com/t/sign-in-with-a-console-application/16368/2 "2021-09-28T22:37:58Z")

</div>

We don’t have an example for C# but there is a blog post for Node.js that does something similar.

> **[OAuth 2.0 for Native and Mobile Apps](https://developer.okta.com/blog/2018/12/13/oauth-2-for-native-and-mobile-apps)**
>
> Native and Mobile apps have special requirements for using OAuth 2.0.

---

<div class="post-metadata">

**Author:** ![Shawn565](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@Shawn565](https://devforum.okta.com/u/Shawn565)\
**Post date:** [September 29, 2021, 3:22pm UTC](https://devforum.okta.com/t/sign-in-with-a-console-application/16368/3 "2021-09-29T15:22:52Z")

</div>

Is there any C# okta sdk that can spawn a browser with the login for native applications? Similar to what is done above?

---

<div class="post-metadata">

**Author:** ![okra-okta](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/okra-okta/32/2838_2.png) [@okra-okta](https://devforum.okta.com/u/okra-okta)\
**Post date:** [September 29, 2021, 4:00pm UTC](https://devforum.okta.com/t/sign-in-with-a-console-application/16368/4 "2021-09-29T16:00:47Z")

</div>

Would the Xamarin SDK work?

> **[GitHub - okta/okta-oidc-xamarin: Okta OIDC SDK for Xamarin](https://github.com/okta/okta-oidc-xamarin)**
>
> Okta OIDC SDK for Xamarin. Contribute to okta/okta-oidc-xamarin development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![Shawn565](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@Shawn565](https://devforum.okta.com/u/Shawn565)\
**Post date:** [September 29, 2021, 6:23pm UTC](https://devforum.okta.com/t/sign-in-with-a-console-application/16368/5 "2021-09-29T18:23:42Z")

</div>

Sorry I miswrote in my previous reply. I meant a C# okta sdk that can spawn a browser for a console application. This application would be called by another program to just deal with signing in through Okta.

---

<div class="post-metadata">

**Author:** ![okra-okta](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/okra-okta/32/2838_2.png) [@okra-okta](https://devforum.okta.com/u/okra-okta)\
**Post date:** [September 29, 2021, 9:00pm UTC](https://devforum.okta.com/t/sign-in-with-a-console-application/16368/6 "2021-09-29T21:00:38Z")

</div>

Oh, then unfortunately no. I’m not aware of any C# Okta SDK that will support this.

---

<div class="post-metadata">

**Author:** ![Blind\_coder](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/blind_coder/32/4313_2.png) [@Blind\_coder](https://devforum.okta.com/u/Blind_coder)\
**Post date:** [November 4, 2022, 10:27pm UTC](https://devforum.okta.com/t/sign-in-with-a-console-application/16368/7 "2022-11-04T22:27:27Z")

</div>

@Shawn565 You can check this article. Here is one nice example illutrating same thing.

> **[How to connect Console, Background Services Application With Okta,...](https://stackpine.com/technology/dotnet-core/authentication-for-native-applications-okta/)**
>
> In this article, We will see How to connect Console application, background services or automated test scripts to fetch token from Okta. this code snippet can

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 12, 2024, 10:18pm UTC](https://devforum.okta.com/t/sign-in-with-a-console-application/16368/8 "2024-02-12T22:18:33Z")

</div>

Closed on February 12, 2024, 10:18pm UTC


