I'm using Microsoft.IdentityModel.Tokens to create a JWT but I need a token with no expiration date, can I create that token with the CreateJwtSecurityToken function? I tried ignoring the expires parameter but that not work.
JWT with no expires date
253 Views Asked by M. Gar At
1
There are 1 best solutions below
Related Questions in ASP.NET-WEB-API
- Log to Dynatrace using Serilog and web.config .NET Framework API
- How to create a REST API with .NET Framework?
- ASP.NET Core Background task with service container
- App gateway closing connection after 100 requests
- Web API works with Windows authentication enabled when consumed via Swagger but throws an unauthorized issue when accessed through web app
- The 'GetUriByAction' method in the LinkGenerator class in Asp.Net Core is not defined in the Repository layer of the project
- Entity Tracking Conflict when Authenticating Users in ASP.NET Core API
- Class validation on response body in .NET WebApi
- My ASP.NET server does not work and I am wondering what's missing, when I open Swagger, I get error 500
- How to split Serilog log file into multiple files?
- Response payload is not odata payload
- How can I upload picture
- Web Forms aspx - PostAsync Web API
- do you know any free reporting services like devexpress or boldreports?
- WebAPI don't deserialize JSON but same payload works in Swagger
Related Questions in JWT
- Generate Databricks personal access token using REST API
- How to share JWT through 2 React.js Frontend
- I'm trying to understand JWT-based authorization between applications
- Error: Cannot invoke "jakarta.servlet.http.HttpSession.getAttribute(String)" because "session" is null
- How to implement Access / Refresh Tokens
- RequestClientCredentialsTokenAsync and ClientAssertion Encoded
- How to prevent users from creating custom client apps?
- Minimizing IdentityServer4 Round Trips in Microservice Architecture with Ocelot
- How to Link JWT User ID with PayPal Custom ID After Payment in Node.js?
- How to verify JWS (x5c chain) is signed by apple using Jose
- getting React Hook "useSetupInterceptors" cannot be called at the top level when try to use useSignOut hook
- System.InvalidOperationException: The AuthorizationPolicy named: 'Admin' was not found
- Wondering if AWS Amplify sdk for SSR automatically verifies user identities or JWT?
- Implementing JWT Token Authorization in .NET 8 using AddJwtBearer() with a Custom Role Based Attributes
- Extracting and Storing Value of a Initial Header in NGINX
Related Questions in IDENTITYMODEL
- .net 4.8 IdentityModel The located assembly's manifest definition does not match the assembly reference
- How can I bypass certificate (SSL) validation in OAuth2Introspection?
- Disabling Kerberos in Webview based OpenID Connect Authentication
- JwtSecurityToken.WriteToken causes "The type initializer for 'System.IdentityModel.Tokens.Jwt.JsonExtensions' threw an exception."
- Owin OpenId connection with NET Framework - error IDX21323
- What is the relationship between System.IdentityModel and Microsoft.Data.SqlClient?
- Issue with IdentityModel.Tokens.Jwt > CreateJwtSecurityToken on Windows Server 2022 VM, working on Windows 11 Pro locally. What could be the reason?
- Does MSAL work only with azure and Microsoft identity platform?
- IdentityServer4 sample code gives unauthorized_client error
- Is there a way to use IdentityModel for automated token manegement with HTTP Clients inside Azure Activity Functions?
- IdentityModel breaks with "Could not load file or assembly 'System.Numerics.Vectors, Version=4.1.4.0"
- Understanding & Using Microsoft Identity
- how to define AuthorizationCodeTokenRequest with ClientAssertion
- How can I use IdentityModel.OidcClient in a c# webapi to verify and validate token generated from active directory service supporting openid connect?
- IDX10503: Signature validation failed. Token does not have a kid. Keys tried: 'System.Text.StringBuilder'
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
An alternative is to have the ASP.NET WEB.API to ignore the expire dates of the token using this property:
TokenValidationParameters.ValidateLifetime
You set it inside AddJwtBearer(...);
To complement this answer, I wrote a blog post that goes into more detail about this topic: Troubleshooting JwtBearer authentication problems in ASP.NET Core