-
Notifications
You must be signed in to change notification settings - Fork 561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HttpSecurity exceptionHandling not working #370
Comments
Looks like the exception is bubbling up all the way to the container handler library and is not being trapped by an exception mapper within Spring: |
Hey, is there any updated on the issue is appreciable. I am also facing same thing when trying to authenticate in springboot2 with aws-serverless-java-container version 1.9.1. Below is the error: |
Hi @abdulrais, |
Thanks for your response @deki. I am trying to authenticate REST APIs using OAuth2 with azure AD in aws lambda. While sending request in lambda function. I am facing above exception while authenticating it. Below is the even json: { Steps:
Step 1 where I am getting exception while testing it in aws lambda. Exception: java.lang.NullPointerException: null |
I'm facing same thing with @abdulrais . I've already opened this issue at https://stackoverflow.com/questions/75445394/error-when-spring-on-lambda-calls-azure-ad |
@deki Thank you for your response. I've already made my project public. You can use this https://github.com/poknovem/test-aws-lambda.git with my Azure AD for testing. |
Nice, I will try it out. |
thanks, @deki, it will be a huge help. |
I've replied to the Stackoverflow post: https://stackoverflow.com/a/75471488/3156607 This issue is about Spring Security exception handling in general, so the issue you were facing doesn't seem related. |
thanks @deki. It seems issues was related to Spring security, It works fine for me atleast no more nullPointerException. |
Serverless Java Container version:
1.5.1
Implementations:
Spring Boot 2
Framework version:
2.2.6.RELEASE
Frontend service:
REST API
Deployment method:
SAM
Scenario
My current WebSecurityConfiguration:
My StreamLambdaHandler:
I throw the exception on:
Locally, when I have a JWT error, like expired token, I received the correct message that is processed on JwtAuthenticationEntryPoint.
On AWS Lambda it seems that there is no authenticationEntryPoint, as it didn't exist, I tried put logs on JwtAuthenticationEntryPoint and these logs didn't appear.
Expected behavior
Http status 403 with correct body.
Actual behavior
On Lambda, I receive
I appreciate any help.
Thanks in advance.
Full log output
Lambda function's CloudWatch logs
The text was updated successfully, but these errors were encountered: