sample-modules/login-api/src/main/kotlin/com/example/loginapi/CubeJwtAccessTokenConverter.kt

20 lines
646 B
Kotlin

package com.example.loginapi
import org.springframework.security.oauth2.provider.OAuth2Authentication
import org.springframework.security.oauth2.provider.token.DefaultAccessTokenConverter
import org.springframework.stereotype.Component
/**
* @author sombochea <Sambo Chea>
* @email sombochea@cubetiqs.com
* @date 16/10/19
* @since 1.0
*/
@Component
class CubeJwtAccessTokenConverter : DefaultAccessTokenConverter() {
override fun extractAuthentication(map: Map<String?, *>?): OAuth2Authentication {
val authentication = super.extractAuthentication(map)
authentication.details = map
return authentication
}
}