Class McpAuthenticationEntryPoint
java.lang.Object
org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint
com.xebialabs.deployit.plumbing.authentication.Http401AuthenticationEntryPoint
com.xebialabs.xlrelease.mcp.oauth.McpAuthenticationEntryPoint
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean,org.springframework.security.web.AuthenticationEntryPoint
public class McpAuthenticationEntryPoint
extends com.xebialabs.deployit.plumbing.authentication.Http401AuthenticationEntryPoint
Entry point for the MCP endpoint's security chain: behaves like
Http401AuthenticationEntryPoint, but additionally advertises the RFC 9728 protected
resource metadata on the 401 via a WWW-Authenticate: Bearer resource_metadata="..."
challenge. This is the discovery hint that lets MCP clients (Claude, etc.) locate the OIDC
authorization server and start the OAuth 2.1 + PKCE flow. Clients that authenticate with a PAT
or basic auth never see a 401, so they are unaffected.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcommence(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException authException) Methods inherited from class org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint
afterPropertiesSet, getRealmName, setCharset, setRealmName
-
Constructor Details
-
McpAuthenticationEntryPoint
- Parameters:
resourceMetadataUrl- supplier of the absolute protected-resource-metadata URL; empty when discovery should not be advertised (no OIDC issuer configured or MCP server disabled) — then the parent's plain 401 is sent.
-
-
Method Details
-
commence
public void commence(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException authException) throws IOException - Specified by:
commencein interfaceorg.springframework.security.web.AuthenticationEntryPoint- Overrides:
commencein classcom.xebialabs.deployit.plumbing.authentication.Http401AuthenticationEntryPoint- Throws:
IOException
-