SShortSingh.
Back to feed

How JWT Authentication and Refresh Tokens Work in ASP.NET Core .NET 10

0
·1 views

JWT authentication in ASP.NET Core involves issuing a short-lived access token upon successful login, which the client includes in API request headers for authorization. Because short-lived tokens expire quickly, refresh tokens are introduced alongside them to allow clients to obtain new access tokens without requiring users to log in again. The server validates the refresh token and, if valid, issues both a new access token and a new refresh token. This tutorial uses .NET 10, ASP.NET Core Web API, SQL Server, Entity Framework Core, and ASP.NET Core Identity to build the authentication system. A custom ApplicationUser model extending IdentityUser is created to store user-specific data including the refresh token and its expiry time.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Developer's 0% test score was a false alarm caused by an empty API credit account

A developer using Claude Code discovered that a test report showing 0 out of 96 passing was not due to actual test failures, but because the account had run out of API credits. The incident exposed a fundamental flaw in how many evaluation scripts handle infrastructure failures — they report a zero score instead of signalling that measurement was impossible. Further investigation revealed a second bug: the scoring tool only captured stdout while warnings went to stderr, meaning it had never actually evaluated pass or fail results on any run. The developer also found that a handoff document incorrectly stated no test cases existed for 24 AI skills, when in fact all 24 had full test coverage. The episode highlights the importance of distinguishing between a failed test and a failure to run the test at all.

0
ProgrammingDEV Community ·

A Practical Guide to Database Indexing for Analysts: When and Why It Matters

Data analyst Michael Nocito published a practical guide on August 8, 2026, explaining when and how to use database indexes to speed up slow queries. The guide focuses on the fundamental difference between a full table scan, where the engine reads every row, and an index scan, where it jumps directly to the needed value using a sorted structure. Nocito demonstrates concepts using a 500,000-row SQLite orders table, with each query timed across five runs to provide real-world performance comparisons. Readers are shown how to use EXPLAIN QUERY PLAN to diagnose whether a query is scanning an entire table, a technique that works across major databases including PostgreSQL. The guide also covers the costs and limitations of indexes, including why an index on one column offers no benefit to queries filtering on a different column.

0
ProgrammingDEV Community ·

How a 100% Funnel Conversion Rate Usually Signals a Skippable Step

Data analyst Michael Nocito published a technical guide on August 8, 2026, explaining how to build funnel conversion queries in SQL using DuckDB. The tutorial walks through converting a raw events table into a step-by-step funnel, calculating the share of users progressing between stages. A central insight is that any funnel step converting at or near 100% is rarely a sign of perfect performance — it typically indicates a step that can be bypassed or is logged as a side effect of a later action. Nocito demonstrates this using a deliberately small dataset of 24 events across 10 sessions, making every number manually verifiable. The guide emphasizes defining three key parameters before writing any query: what is being counted, the ordered steps, and the time window over which conversions are measured.

0
ProgrammingDEV Community ·

How SQL Date Functions Prevent Missing Months When Grouping by Month

Data analyst Michael Nocito published a practical SQL guide on August 8, 2026, explaining how to correctly group database records by month without silently losing months that had no activity. The core technique uses DATE_TRUNC('month', date_column), which snaps every date to the first of its month, allowing GROUP BY to aggregate all dates within a month into a single value. Nocito warns that a missing month never becomes a row in results, meaning gaps can quietly skew comparisons in monthly reports. The guide covers date arithmetic, period filtering, and the differences between DATE, TIMESTAMP, and TIMESTAMP WITH TIME ZONE data types. All queries were tested in DuckDB and SQLite, with syntax largely compatible with PostgreSQL, Redshift, and Snowflake.