package it.inaf.ia2.gms.authn; import java.util.Collection; import java.util.Map; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.oauth2.common.OAuth2AccessToken; public class CustomAuthenticationData extends UsernamePasswordAuthenticationToken { private final Map attributes; private final OAuth2AccessToken accessToken; private final String refreshToken; public CustomAuthenticationData(String username, Map attributes, Collection authorities, OAuth2AccessToken accessToken, String refreshToken) { super(username, "N/A", authorities); this.attributes = attributes; this.accessToken = accessToken; this.refreshToken = refreshToken; } public Map getAttributes() { return attributes; } public OAuth2AccessToken getAccessToken() { return accessToken; } public String getRefreshToken() { return refreshToken; } }