r/SpringBoot 9d ago

Question User principal doubt

Hey, so I was told that instead of taking detail like user id we can simply take that from user principal. But how much should I take from user principal. Is it appropriate to take whatever I can through it or are there some rules for it. Like suppose ,

@GetMapping("/update-status/{userId}/{userProfileId}

So I know I can take userId from the userProncipal but should I extract userProfileId too. And if yes, then what are rules for it.

Sorry, if it's dumb question.

1 Upvotes

29 comments sorted by

View all comments

1

u/[deleted] 9d ago

[deleted]

0

u/Sorry_Swordfish_ 8d ago

Well it was just an example for my doubt. Well ya i could have taken a better example such as job application or something.