当前位置: 首页>>代码示例>>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;未经允许,请勿转载。