# Close/cleanup Okta session

**URL:** <https://devforum.okta.com/t/close-cleanup-okta-session/15024>\
**Category:** Questions\
**Tags:** dotnet\
**Created:** [July 6, 2021, 9:48am UTC](https://devforum.okta.com/t/close-cleanup-okta-session/15024 "2021-07-06T09:48:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulpopa](https://avatars.discourse-cdn.com/v4/letter/p/bc79bd/32.png) [@paulpopa](https://devforum.okta.com/u/paulpopa)\
**Post date:** [July 6, 2021, 9:48am UTC](https://devforum.okta.com/t/close-cleanup-okta-session/15024/1 "2021-07-06T09:48:45Z")

</div>

Hi,

Is there a way of closing an Okta connection or doing some cleanup after creating an user?

I’m authenticating a user successfully in my WCF service using Okta.Auth.Sdk, but sometimes I also need to create the user before authentication. If I create the user using Okta.Sdk in a console application and then authenticate in the same process - it works. But if I move that code in WCF, the authentication fails.

The authentication in WCF doesn’t work anymore even if I create the user in the external app using Okta.Sdk or with Postman. I need to restart the WCF service to be able to authenticate the new user.

The exception that I get is “An existing connection was forcibly closed by the remote host”.

Thank you!  
Paul

---

<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 8, 2024, 6:38pm UTC](https://devforum.okta.com/t/close-cleanup-okta-session/15024/2 "2024-02-08T18:38:49Z")

</div>

Closed on February 8, 2024, 6:38pm UTC


