-
Notifications
You must be signed in to change notification settings - Fork 2
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
Spring Method Security using Authorization Manager #22
Open
vladaspasic
wants to merge
4
commits into
master
Choose a base branch
from
use-new-method-security
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vladaspasic
requested review from
iznenad,
jeramadon,
McFcologne,
mikailcolak,
michaelprimez,
acoppola and
zarkovicmila
October 2, 2023 11:13
|
acoppola
approved these changes
Oct 11, 2023
mikailcolak
approved these changes
Feb 20, 2024
@mikailcolak do you need this update for MIDA? |
|
|
Not urgently, but I think I would like to have this for the next MIDA release (not the one we are currently working on that we are going to release soon). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With Spring Security 6 the
@EnableGlobalSecurity
has been deprecated, here is the transition path:https://docs.spring.io/spring-security/reference/servlet/authorization/method-security.html#migration-enableglobalmethodsecurity
The new approach does not require us to use the
AccessDecisionVoter
nor we need to enable method security via annotations for this library. It is now sufficient to register the AOP method interceptor bean using theAuthorizationManagerBeforeMethodInterceptor
implementation. The interceptor uses our custom implementation of theAuthorizationManager
interface to check if the method can be invoked or not.It is now possible to use this library in conjunction with the
@EnableGlobalSecurity
, which was not possible before. You can now mix and match the@Permission
and@PreAuthorize
or@PostAuthorize
permissions if it is required.The deprecated classes have been removed from this library as they are no longer needed. The usage of this library does not change one bit.