类 DefaultAuthenticationEntryPoint

java.lang.Object
io.github.lishangbu.orange.oauth2.common.web.authentication.DefaultAuthenticationEntryPoint
所有已实现的接口:
org.springframework.security.web.AuthenticationEntryPoint

public class DefaultAuthenticationEntryPoint extends Object implements org.springframework.security.web.AuthenticationEntryPoint
统一的认证入口点,用于在未认证或认证失败时返回统一的 JSON 错误响应

此类由 ExceptionTranslationFilter 在需要发起认证流程时调用(commence), 返回 HTTP 401 状态以及统一的业务错误码,便于前端和网关识别和处理

从以下版本开始:
2025/8/22
作者:
lishangbu
  • 构造器详细资料

    • DefaultAuthenticationEntryPoint

      public DefaultAuthenticationEntryPoint()
  • 方法详细资料

    • commence

      public void commence(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException authException)
      指定者:
      commence 在接口中 org.springframework.security.web.AuthenticationEntryPoint