exceptionfactory opened a new pull request, #6233:
URL: https://github.com/apache/nifi/pull/6233

   # Summary
   
   [NIFI-10259](https://issues.apache.org/jira/browse/NIFI-10259) Improves HTTP 
error handling for authentication failures, providing additional details when 
the web application rejects a JWT Bearer Token.
   
   Improvements include introducing `StandardAuthenticationEntryPoint`, which 
delegates to the Spring Security `BearerTokenAuthenticationEntryPoint` for 
OAuth2 Authentication Exceptions. The `BearerTokenAuthenticationEntryPoint` 
prepares a standard `WWW-Authenticate` HTTP response header containing error 
parameters described in [RFC 6749 Section 
5.2](https://www.rfc-editor.org/rfc/rfc6749.html#section-5.2). The new 
`StandardAuthenticationEntryPoint` uses the response header as the basis for a 
response body.
   
   For all other Authentication Exceptions, the 
`StandardAuthenticationEntryPoint` returns an HTTP 401 status code with a 
response containing a message stating `Unauthorized`. This builds on the 
current configuration, which returns an HTTP 401 status code without a response 
body.
   
   The `StandardAuthenticationEntryPoint` also checks for the presence of the 
HTTP Authorization Bearer Cookie, and sets a response header instructing the 
client to remove the cookie from storage. This implementation follows the 
strategy in `AccessResource.getAccessStatus()` and provides a more consistent 
approach.
   
   Configuration updates include using the `StandardAuthenticationEntryPoint` 
as the default Authentication Entry Point for both the Spring Security Filter 
Chain and the Bearer Token Authentication Filter.
   
   # Tracking
   
   Please complete the following tracking steps prior to pull request creation.
   
   ### Issue Tracking
   
   - [X] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue 
created
   
   ### Pull Request Tracking
   
   - [X] Pull Request title starts with Apache NiFi Jira issue number, such as 
`NIFI-00000`
   - [X] Pull Request commit message starts with Apache NiFi Jira issue number, 
as such `NIFI-00000`
   
   ### Pull Request Formatting
   
   - [X] Pull Request based on current revision of the `main` branch
   - [X] Pull Request refers to a feature branch with one commit containing 
changes
   
   # Verification
   
   Please indicate the verification steps performed prior to pull request 
creation.
   
   ### Build
   
   - [X] Build completed using `mvn clean install -P contrib-check`
     - [X] JDK 8
     - [ ] JDK 11
     - [ ] JDK 17
   
   ### Licensing
   
   - [ ] New dependencies are compatible with the [Apache License 
2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License 
Policy](https://www.apache.org/legal/resolved.html)
   - [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` 
files
   
   ### Documentation
   
   - [ ] Documentation formatting appears as expected in rendered files
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to