當前位置: 首頁>>代碼示例>>Java>>正文


Java OAuth2Authentication.setDetails方法代碼示例

本文整理匯總了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;
}
 
開發者ID:xm-online,項目名稱:xm-ms-balance,代碼行數:18,代碼來源:DomainJwtAccessTokenConverter.java

示例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);
}
 
開發者ID:xm-online,項目名稱:xm-uaa,代碼行數:12,代碼來源:DomainTokenServices.java

示例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;
}
 
開發者ID:xm-online,項目名稱:xm-uaa,代碼行數:12,代碼來源:DomainJwtAccessTokenConverter.java

示例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;
}
 
開發者ID:xm-online,項目名稱:xm-ms-dashboard,代碼行數:15,代碼來源:DomainJwtAccessTokenConverter.java

示例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;
}
 
開發者ID:xm-online,項目名稱:xm-ms-entity,代碼行數:11,代碼來源:DomainJwtAccessTokenConverter.java

示例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;
}
 
開發者ID:xm-online,項目名稱:xm-ms-config,代碼行數:14,代碼來源:DomainJwtAccessTokenConverter.java


注:本文中的org.springframework.security.oauth2.provider.OAuth2Authentication.setDetails方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。