Auth0 Home Blog Docs

RBAC using spring-security

Hi All, I am new to auth0. I need a small clarification regarding implementation of RBAC with spring security. My question is

Is it possible to provide authorization by using PreAuthenticatedAuthenticationToken ?

Thanks in advance

You can gain access to the permission claims via Authentication.getDetails().

Here’s some code (kotlin):

fun Authentication.permissions(): List {
val d = this.details
return if (d is DecodedJWT)
d.getClaim(“permissions”).asList(String::class.java)
else
emptyList()
}

hth