# How to get all user Claims with tokenOptions

**URL:** <https://community.auth0.com/t/how-to-get-all-user-claims-with-tokenoptions/59486>\
**Category:** Get Help\
**Tags:** auth0\
**Created:** [March 15, 2021, 9:32pm UTC](https://community.auth0.com/t/how-to-get-all-user-claims-with-tokenoptions/59486 "2021-03-15T21:32:35Z")\
**Posts on this page:** 1\
**Showing post:** 27

<div class="post-metadata">

**Author:** ![k-auth0](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/k-auth0/32/18365_2.png) [@k-auth0](https://community.auth0.com/u/k-auth0)\
**Post date:** [March 25, 2021, 9:12pm UTC](https://community.auth0.com/t/how-to-get-all-user-claims-with-tokenoptions/59486/27 "2021-03-25T21:12:46Z")

</div>

Still Nightmares

> [@Spring Boot Authorization Tutorial: Secure an API (Java)](https://community.auth0.com/t/spring-boot-authorization-tutorial-secure-an-api-java/56565):
>
> Learn how to use Spring Boot, Java, and Auth0 to secure a feature-complete API. Learn how to use Auth0 to implement authorization in Spring Boot. [Read more…](https://auth0.com/blog/spring-boot-authorization-tutorial-secure-an-api-java/) Brought for you by Tadej Slamic

Once there was this object - AuthenticationJsonWebToken

May be it is now - @AuthenticationPrincipal OidcUser principal

The example doesn’t give enough logs to understand. I would be nice to write small example, which I think is part of unit testing, as Spring users is one huge community. Lots of ellipses in the example {…}

> @DeleteMapping(“/{id}”)  
> @PreAuthorize(“hasAuthority(‘delete:items’)”) // ✨ 👈 New line ✨  
> public ResponseEntity delete(@PathVariable(“id”) Long id) {…}
> 
> ```
> @ExceptionHandler(MethodArgumentNotValidException.class)
> public ResponseEntity<Map<String, String>> handleValidationExceptions(
> MethodArgumentNotValidException ex) {...}
> 
> ```

Too much forcing like -@EnableGlobalMethodSecurity(prePostEnabled = true) and endpoints @PreAuthorize(“hasAuthority(‘create:items’)”) is unwanted

Can anyone tell me - how can I print the claims using the above example.

---

_[View the full topic](https://community.auth0.com/t/how-to-get-all-user-claims-with-tokenoptions/59486)._
