本文整理匯總了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;
}