I have followed this tutorial (Auth0 Spring Boot API SDK Quickstarts: Authorization) and successfully created working authentication flow for my Java API backend.
@GetMapping("/posts")
fun String(): getPosts: List<String> {
val userId: String = "google-oauth2|108335805846181510876"
val posts: List<String> = postDao.listPosts(userId);
return posts;
}
How should I get the userId from the token?