UserInfo

class UserInfo : User, OAuth2AuthenticatedPrincipal

OAuth2 用户信息对象

基于 Spring Security 的 User 扩展附加属性,便于在令牌相关接口中返回更多用户信息

Author

lishangbu

Since

2025/8/9

Constructors

Link copied to clipboard
constructor(username: String, password: String?, authorities: Collection<out GrantedAuthority>)
constructor(username: String, password: String?, enabled: Boolean, accountNonExpired: Boolean, credentialsNonExpired: Boolean, accountNonLocked: Boolean, authorities: Collection<out GrantedAuthority>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
open override val attributes: MutableMap<String, Any>
Link copied to clipboard
open override val authorities: Collection<GrantedAuthority>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open val isEnabled: Boolean
Link copied to clipboard
open override val name: String
Link copied to clipboard
open val password: @Nullable String?
Link copied to clipboard
open val username: String

Functions

Link copied to clipboard
open fun eraseCredentials()
Link copied to clipboard
@Nullable
open fun <A : Any?> getAttribute(name: String?): A?
Link copied to clipboard
open override fun getAttributes(): MutableMap<String, Any>

返回附加属性映射

Link copied to clipboard
open fun getAuthorities(): Collection<GrantedAuthority>
Link copied to clipboard
open override fun getName(): String

返回主体名称

Link copied to clipboard
open override fun toString(): String

返回对象的字符串表示