@Test void testGetTokenUserInfo() { DefaultOAuth2AccessToken token = new DefaultOAuth2AccessToken(TOKEN); Map<String, Object> additionalInformation = asMap(USER_ID, USER_NAME); token.setAdditionalInformation(additionalInformation); UserInfo userInfo = SecurityUtil.getTokenUserInfo(token); assertEquals(USER_ID, userInfo.getId()); assertEquals(USER_NAME, userInfo.getName()); assertEquals(TOKEN, userInfo.getToken() .getValue()); }
public static UserInfo getTokenUserInfo(OAuth2AccessToken token) { TokenProperties tokenProperties = TokenProperties.fromToken(token); return new UserInfo(tokenProperties.getUserId(), tokenProperties.getUserName(), token); }
SecurityUtil { public static UserInfo getTokenUserInfo(OAuth2AccessToken token) { TokenProperties tokenProperties = TokenProperties.fromToken(token); return new UserInfo(tokenProperties.getUserId(), tokenProperties.getUserName(), token); } }
SecurityUtil { public static UserInfo getTokenUserInfo(OAuth2AccessToken token) { TokenProperties tokenProperties = TokenProperties.fromToken(token); return new UserInfo(tokenProperties.getUserId(), tokenProperties.getUserName(), token); } private  SecurityUtil(); }
SecurityUtil { public static UserInfo getTokenUserInfo(OAuth2AccessToken token) { TokenProperties tokenProperties = TokenProperties.fromToken(token); return new UserInfo(tokenProperties.getUserId(), tokenProperties.getUserName(), token); } private  SecurityUtil(); static OAuth2Authentication createAuthentication(String clientId, Set<String> scope, UserInfo userInfo); static UserInfo getTokenUserInfo(OAuth2AccessToken token); }
SecurityUtil { public static UserInfo getTokenUserInfo(OAuth2AccessToken token) { TokenProperties tokenProperties = TokenProperties.fromToken(token); return new UserInfo(tokenProperties.getUserId(), tokenProperties.getUserName(), token); } private  SecurityUtil(); static OAuth2Authentication createAuthentication(String clientId, Set<String> scope, UserInfo userInfo); static UserInfo getTokenUserInfo(OAuth2AccessToken token); static final String CLIENT_ID; static final String CLIENT_SECRET; }