# How to use getTokenSilently in .NET 6?

**URL:** <https://community.auth0.com/t/how-to-use-gettokensilently-in-net-6/92506>\
**Category:** Get Help\
**Tags:** dotnet6, silent-authentication, aspnet-mvc\
**Created:** [October 17, 2022, 8:28am UTC](https://community.auth0.com/t/how-to-use-gettokensilently-in-net-6/92506 "2022-10-17T08:28:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![randy.grouls](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/randy.grouls/32/34225_2.png) [@randy.grouls](https://community.auth0.com/u/randy.grouls)\
**Post date:** [October 17, 2022, 8:28am UTC](https://community.auth0.com/t/how-to-use-gettokensilently-in-net-6/92506/1 "2022-10-17T08:28:45Z")

</div>

I have seen some examples of the SPA sdk’s where there is the option to use getTokenSilently to for example check if a user still has a valid Auth0 session. My problem is that I can’t find this functionality in the Auth0.AspNetCore.Authentication package.

How do I achieve this functionality with this SDK? I am using a .NET 6 MVC web application.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [October 27, 2022, 6:46pm UTC](https://community.auth0.com/t/how-to-use-gettokensilently-in-net-6/92506/3 "2022-10-27T18:46:44Z")

</div>

Hi @randy.grouls,

getTokenSilently is specific to _Single Page Apps_. Silent auth allows for short lived tokens in public apps, via a cookie session for persistence.

For your app, you may want to consider using a refresh token for a similar type of flow. Here is a blog on the subject:

> **[Use Refresh Tokens in ASP.NET Core Apps](https://auth0.com/blog/use-refresh-tokens-in-aspnet-core-apps/)**
>
> Learn why and how to use refresh tokens in ASP.NET Core applications.

---

<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:** [November 10, 2022, 6:47pm UTC](https://community.auth0.com/t/how-to-use-gettokensilently-in-net-6/92506/4 "2022-11-10T18:47:27Z")

</div>

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