1234567891011121314 |
- [[servlet-authentication-authenticationentrypoint]]
- = Request Credentials with `AuthenticationEntryPoint`
- {security-api-url}org/springframework/security/web/AuthenticationEntryPoint.html[`AuthenticationEntryPoint`] is used to send an HTTP response that requests credentials from a client.
- Sometimes a client will proactively include credentials such as a username/password to request a resource.
- In these cases, Spring Security does not need to provide an HTTP response that requests credentials from the client since they are already included.
- In other cases, a client will make an unauthenticated request to a resource that they are not authorized to access.
- In this case, an implementation of `AuthenticationEntryPoint` is used to request credentials from the client.
- The `AuthenticationEntryPoint` implementation might perform a <<servlet-authentication-form,redirect to a log in page>>, respond with an <<servlet-authentication-basic,WWW-Authenticate>> header, etc.
|