Replit api

Spring Actuator Endpoints Returning 401

Spring Actuator endpoints (/actuator/metrics, /actuator/health) return 401 Unauthorized. Metrics and health checks are blocked.

Security configuration restricts actuator access inappropriately.

Error Messages You Might See

401 Unauthorized Access Denied Authentication required
401 UnauthorizedAccess DeniedAuthentication required

Common Causes

  1. Authentication required for actuator endpoints
  2. ROLE not matching actuator security rule
  3. Actuator endpoints not exposed in application.yml
  4. Too strict SecurityFilterChain
  5. CSRF token missing for POST requests

How to Fix It

In application.yml: management.endpoints.web.exposure.include=health,metrics. In SecurityConfig: permitAll() for /actuator/** or httpBasic(). Use @EnableSpringDataWebSupport for proper role checking. For development, disable auth: management.security.enabled=false (NOT for production).

Real developers can help you.

Nam Tran Nam Tran 10 years as fullstack developer BurnHavoc BurnHavoc Been around fixing other peoples code for 20 years. Dor Yaloz Dor Yaloz SW engineer with 6+ years of experience, I worked with React/Node/Python did projects with React+Capacitor.js for ios Supabase expert rayush33 rayush33 JavaScript (React.js, React Native, Node.js) Developer with demonstrated industry experience of 4+ years, actively looking for opportunities to hone my skills as well as help small-scale business owners with solutions to technical problems Krishna Sai Kuncha Krishna Sai Kuncha Experienced Professional Full stack Developer with 8+ years of experience across react, python, js, ts, golang and react-native. Developed inhouse websearch tooling for AI before websearch was solved : ) Jen Jacobsen Jen Jacobsen I’m a Full-Stack Developer with over 10 years of experience building modern web and mobile applications. I enjoy working across the full product lifecycle — turning ideas into real, well-built products that are intuitive for users and scalable for businesses. I particularly enjoy building mobile apps, modern web platforms, and solving complex technical problems in a way that keeps systems clean, reliable, and easy to maintain. MFox MFox Full-stack professional senior engineer (15+years). Extensive experience in software development, qa, and IP networking. Luca Liberati Luca Liberati I work on monoliths and microservices, backends and frontends, manage K8s clusters and love to design apps architecture Victor Denisov Victor Denisov Developer Jaime Orts-Caroff Jaime Orts-Caroff I'm a Senior Android developer, open to work in various fields

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

Which endpoints should be public?

/actuator/health is usually public. /actuator/metrics usually needs auth

How do I expose all actuator endpoints?

management.endpoints.web.exposure.include=* (only for internal apps!)

Related Replit Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help