We have scoped our roles, so we need to create proper classes. Create a new package called security. The first class we will create will be the class that represents user definition. Create a class called User and make sure it extends the UserDetails class from the org.springframework.security.core.userdetails package:
package com.journaler.api.security ... import org.springframework.security.core.GrantedAuthority import org.springframework.security.core.userdetails.UserDetails ... open class User : UserDetails { override fun getAuthorities(): MutableCollection<out GrantedAuthority> { ... } override fun isEnabled(): Boolean { ... } override fun getUsername(): String { ... } override fun isCredentialsNonExpired(): ...