Protecting Routes
In a React app, routes define the paths within the application that users can navigate to, linking URLs to specific components. Securing routes is essential to protect sensitive data, prevent unauthorized access, and ensure that only authenticated users can access certain parts of the application.
The Asgardeo SDK provides multiple approaches to secure routes in your application. This guide demonstrates how to secure routes in a single-page React app using official Asgardeo router integrations for popular routing libraries.
Choose Your Router​
Custom Implementation
Prefer to build your own route protection? Learn how to create custom route guards using Asgardeo primitives in our custom implementation guide.