Skip to content
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

Deprecate Authentication#setAuthenticated #16668

Open
3 tasks
Tracked by #8323
jzheaux opened this issue Feb 26, 2025 · 0 comments · May be fixed by #16838
Open
3 tasks
Tracked by #8323

Deprecate Authentication#setAuthenticated #16668

jzheaux opened this issue Feb 26, 2025 · 0 comments · May be fixed by #16838
Labels
type: enhancement A general enhancement

Comments

@jzheaux
Copy link
Contributor

jzheaux commented Feb 26, 2025

Authentication#setAuthenticated is not used by Spring Security other than inside of the constructors of Authentication implementations. Further, it's not a great look for an otherwise immutable authentication state to have it's validity be publicly mutable.

For this ticket:

  • Mark Authentication#setAuthenticated as @Deprecated.
  • Add to the JavaDoc, indicating what folks should do (implement isAuthenticated instead)
  • Add to the migration doc instructions to stop using Authentication#setAuthenticated

Existing implementations will need to still call it in order to remain passive, so they should not change in this ticket. That will be in when setAuthenticated is removed.

@jzheaux jzheaux added the type: enhancement A general enhancement label Feb 26, 2025
yybmion added a commit to yybmion/spring-security that referenced this issue Mar 28, 2025
This commit deprecates the Authentication#setAuthenticated method
in favor of implementing isAuthenticated().

Closes spring-projectsgh-16668"
yybmion added a commit to yybmion/spring-security that referenced this issue Mar 28, 2025
This commit deprecates the Authentication#setAuthenticated method
in favor of implementing isAuthenticated().

Closes spring-projectsgh-16668
@yybmion yybmion linked a pull request Mar 28, 2025 that will close this issue
yybmion added a commit to yybmion/spring-security that referenced this issue Mar 28, 2025
This commit deprecates the Authentication#setAuthenticated method
in favor of implementing isAuthenticated().

Closes spring-projectsgh-16668

Signed-off-by: yoobin_mion <[email protected].>
yybmion added a commit to yybmion/spring-security that referenced this issue Mar 28, 2025
This commit deprecates the Authentication#setAuthenticated method
in favor of implementing isAuthenticated().

Closes spring-projectsgh-16668

Signed-off-by: yybmion <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant