本文整理汇总了Java中org.springframework.security.oauth2.provider.OAuth2Authentication.setDetails方法的典型用法代码示例。如果您正苦于以下问题:Java OAuth2Authentication.setDetails方法的具体用法?Java OAuth2Authentication.setDetails怎么用?Java OAuth2Authentication.setDetails使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.security.oauth2.provider.OAuth2Authentication
的用法示例。
在下文中一共展示了OAuth2Authentication.setDetails方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extractAuthentication
import org.springframework.security.oauth2.provider.OAuth2Authentication; //导入方法依赖的package包/类
@Override
public OAuth2Authentication extractAuthentication(Map<String, ?> map) {
final OAuth2Authentication authentication = super.extractAuthentication(map);
final Map<String, String> details = new HashMap<>();
details.put(AUTH_TENANT_KEY, (String) map.get(AUTH_TENANT_KEY));
details.put(AUTH_USER_KEY, (String) map.get(AUTH_USER_KEY));
details.put(AUTH_XM_TOKEN_KEY, (String) map.get(AUTH_XM_TOKEN_KEY));
details.put(AUTH_XM_COOKIE_KEY, (String) map.get(AUTH_XM_COOKIE_KEY));
details.put(AUTH_XM_USER_ID_KEY, (String) map.get(AUTH_XM_USER_ID_KEY));
details.put(AUTH_XM_USER_LOGIN_KEY, (String) map.get(AUTH_XM_USER_LOGIN_KEY));
details.put(AUTH_XM_LOCALE_KEY, (String) map.get(AUTH_XM_LOCALE_KEY));
details.put(AUTH_AE_API_TOKEN_KEY, (String) map.get(AUTH_AE_API_TOKEN_KEY));
details.put(AUTH_CHARGE_API_TOKEN_KEY, (String) map.get(AUTH_CHARGE_API_TOKEN_KEY));
authentication.setDetails(details);
return authentication;
}
示例2: setCustomDetails
import org.springframework.security.oauth2.provider.OAuth2Authentication; //导入方法依赖的package包/类
private void setCustomDetails(OAuth2Authentication authentication) {
final Map<String, Object> details = new HashMap<>();
final Object principal = authentication.getPrincipal();
details.put(AUTH_TENANT_KEY, TenantContext.getCurrent().getTenant());
if (principal instanceof DomainUserDetails) {
final DomainUserDetails userDetails = (DomainUserDetails) principal;
details.put(AUTH_TENANT_KEY, userDetails.getTenant());
details.put(AUTH_USER_KEY, userDetails.getUserKey());
}
authentication.setDetails(details);
}
示例3: extractAuthentication
import org.springframework.security.oauth2.provider.OAuth2Authentication; //导入方法依赖的package包/类
@Override
public OAuth2Authentication extractAuthentication(Map<String, ?> map) {
final OAuth2Authentication authentication = super.extractAuthentication(map);
final Map<String, String> details = new HashMap<>();
details.put(AUTH_TENANT_KEY, (String) map.get(AUTH_TENANT_KEY));
details.put(AUTH_USER_KEY, (String) map.get(AUTH_USER_KEY));
details.put(AUTH_USER_KEY, (String) map.get(AUTH_USER_KEY));
authentication.setDetails(details);
return authentication;
}
示例4: extractAuthentication
import org.springframework.security.oauth2.provider.OAuth2Authentication; //导入方法依赖的package包/类
@Override
public OAuth2Authentication extractAuthentication(Map<String, ?> map) {
final OAuth2Authentication authentication = super.extractAuthentication(map);
final Map<String, String> details = new HashMap<>();
details.put(AUTH_TENANT_KEY, (String) map.get(AUTH_TENANT_KEY));
details.put(AUTH_XM_TOKEN_KEY, (String) map.get(AUTH_XM_TOKEN_KEY));
details.put(AUTH_XM_COOKIE_KEY, (String) map.get(AUTH_XM_COOKIE_KEY));
details.put(AUTH_XM_USERID_KEY, (String) map.get(AUTH_XM_USERID_KEY));
details.put(AUTH_XM_LOCALE, (String) map.get(AUTH_XM_LOCALE));
details.put(AUTH_USER_KEY, (String) map.get(AUTH_USER_KEY));
authentication.setDetails(details);
return authentication;
}
示例5: extractAuthentication
import org.springframework.security.oauth2.provider.OAuth2Authentication; //导入方法依赖的package包/类
@Override
public OAuth2Authentication extractAuthentication(Map<String, ?> map) {
final OAuth2Authentication authentication = super.extractAuthentication(map);
final Map<String, String> details = new HashMap<>();
details.put(AUTH_TENANT_KEY, (String) map.get(AUTH_TENANT_KEY));
details.put(AUTH_USER_KEY, (String) map.get(AUTH_USER_KEY));
authentication.setDetails(details);
return authentication;
}
示例6: extractAuthentication
import org.springframework.security.oauth2.provider.OAuth2Authentication; //导入方法依赖的package包/类
@Override
public OAuth2Authentication extractAuthentication(Map<String, ?> map) {
final OAuth2Authentication authentication = super.extractAuthentication(map);
final Map<String, String> details = new HashMap<>();
details.put(AUTH_TENANT_KEY, (String) map.get(AUTH_TENANT_KEY));
details.put(AUTH_XM_TOKEN_KEY, (String) map.get(AUTH_XM_TOKEN_KEY));
details.put(AUTH_XM_COOKIE_KEY, (String) map.get(AUTH_XM_COOKIE_KEY));
details.put(AUTH_XM_USERID_KEY, (String) map.get(AUTH_XM_USERID_KEY));
details.put(AUTH_XM_LOCALE_KEY, (String) map.get(AUTH_XM_LOCALE_KEY));
authentication.setDetails(details);
return authentication;
}