本文整理了Java中waffle.servlet.WindowsPrincipal.getRolesString()
方法的一些代码示例,展示了WindowsPrincipal.getRolesString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WindowsPrincipal.getRolesString()
方法的具体详情如下:
包路径:waffle.servlet.WindowsPrincipal
类名称:WindowsPrincipal
方法名:getRolesString
[英]Get an array of roles as a string.
[中]以字符串形式获取角色数组。
代码示例来源:origin: salyh/elasticsearch-security-plugin
public List<String> getUserRoles() {
if (request.getUserPrincipal() instanceof GenericPrincipal) {
final GenericPrincipal wp = (GenericPrincipal) request
.getUserPrincipal();
if (wp.getRoles() != null) {
final List<String> roles = Arrays.asList(wp.getRoles());
log.debug("GenericPrincipal roles: " + roles);
return roles;
}
}
if (request.getUserPrincipal() instanceof WindowsPrincipal) {
final WindowsPrincipal wp = (WindowsPrincipal) request
.getUserPrincipal();
log.debug("WindowsPrincipal roles: " + wp.getRolesString());
log.debug("WindowsPrincipal groups: " + wp.getGroups());
if (wp.getRolesString() != null) {
return Arrays.asList(wp.getRolesString().split(","));
}
}
/*if (this.request.getUserPrincipal() instanceof ActiveDirectoryPrincipal) {
final ActiveDirectoryPrincipal ap = (ActiveDirectoryPrincipal) this.request
.getUserPrincipal();
log.debug("ActiveDirectoryPrincipal roles: " + ap.getRoles());
return ap.getRoles();
}*/
return null;
}
代码示例来源:origin: com.github.waffle/waffle-jna
NegotiateSecurityFilter.LOGGER.debug("roles: {}", windowsPrincipal.getRolesString());
subject.getPrincipals().add(windowsPrincipal);
request.getSession(false).setAttribute("javax.security.auth.subject", subject);
代码示例来源:origin: Waffle/waffle
NegotiateSecurityFilter.LOGGER.debug("roles: {}", windowsPrincipal.getRolesString());
subject.getPrincipals().add(windowsPrincipal);
request.getSession(false).setAttribute("javax.security.auth.subject", subject);
代码示例来源:origin: com.github.dblock.waffle/waffle-jna
NegotiateSecurityFilter.LOGGER.debug("roles: {}", windowsPrincipal.getRolesString());
subject.getPrincipals().add(windowsPrincipal);
session.setAttribute("javax.security.auth.subject", subject);
代码示例来源:origin: com.github.dblock.waffle/waffle-spring-security4
@Override
public Authentication authenticate(final Authentication authentication) {
final UsernamePasswordAuthenticationToken auth = (UsernamePasswordAuthenticationToken) authentication;
final IWindowsIdentity windowsIdentity = this.authProvider.logonUser(auth.getName(), auth.getCredentials()
.toString());
WindowsAuthenticationProvider.LOGGER.debug("logged in user: {} ({})", windowsIdentity.getFqn(),
windowsIdentity.getSidString());
if (!this.allowGuestLogin && windowsIdentity.isGuest()) {
WindowsAuthenticationProvider.LOGGER.warn("guest login disabled: {}", windowsIdentity.getFqn());
throw new GuestLoginDisabledAuthenticationException(windowsIdentity.getFqn());
}
final WindowsPrincipal windowsPrincipal = new WindowsPrincipal(windowsIdentity, this.principalFormat,
this.roleFormat);
WindowsAuthenticationProvider.LOGGER.debug("roles: {}", windowsPrincipal.getRolesString());
final WindowsAuthenticationToken token = new WindowsAuthenticationToken(windowsPrincipal,
this.grantedAuthorityFactory, this.defaultGrantedAuthority);
WindowsAuthenticationProvider.LOGGER.info("successfully logged in user: {}", windowsIdentity.getFqn());
return token;
}
代码示例来源:origin: com.github.dblock.waffle/waffle-spring-security4
this.principalFormat, this.roleFormat);
NegotiateSecurityFilter.LOGGER.debug("roles: {}", principal.getRolesString());
代码示例来源:origin: Waffle/waffle
: new WindowsPrincipal(windowsIdentity, this.principalFormat, this.roleFormat);
NegotiateSecurityFilter.LOGGER.debug("roles: {}", principal.getRolesString());
代码示例来源:origin: Waffle/waffle
@Override
public Authentication authenticate(final Authentication authentication) {
final UsernamePasswordAuthenticationToken auth = (UsernamePasswordAuthenticationToken) authentication;
IWindowsIdentity windowsIdentity;
try {
windowsIdentity = this.authProvider.logonUser(auth.getName(), auth.getCredentials().toString());
} catch (final Win32Exception e) {
throw new AuthenticationServiceException(e.getMessage(), e);
}
WindowsAuthenticationProvider.LOGGER.debug("logged in user: {} ({})", windowsIdentity.getFqn(),
windowsIdentity.getSidString());
if (!this.allowGuestLogin && windowsIdentity.isGuest()) {
WindowsAuthenticationProvider.LOGGER.warn("guest login disabled: {}", windowsIdentity.getFqn());
throw new GuestLoginDisabledAuthenticationException(windowsIdentity.getFqn());
}
final WindowsPrincipal windowsPrincipal = new WindowsPrincipal(windowsIdentity, this.principalFormat,
this.roleFormat);
WindowsAuthenticationProvider.LOGGER.debug("roles: {}", windowsPrincipal.getRolesString());
final WindowsAuthenticationToken token = new WindowsAuthenticationToken(windowsPrincipal,
this.grantedAuthorityFactory, this.defaultGrantedAuthority);
WindowsAuthenticationProvider.LOGGER.info("successfully logged in user: {}", windowsIdentity.getFqn());
return token;
}
代码示例来源:origin: com.github.waffle/waffle-spring-security3
: new WindowsPrincipal(windowsIdentity, this.principalFormat, this.roleFormat);
NegotiateSecurityFilter.LOGGER.debug("roles: {}", principal.getRolesString());
代码示例来源:origin: Waffle/waffle
: new WindowsPrincipal(windowsIdentity, this.principalFormat, this.roleFormat);
NegotiateSecurityFilter.LOGGER.debug("roles: {}", principal.getRolesString());
代码示例来源:origin: Waffle/waffle
@Override
public Authentication authenticate(final Authentication authentication) {
final UsernamePasswordAuthenticationToken auth = (UsernamePasswordAuthenticationToken) authentication;
IWindowsIdentity windowsIdentity;
try {
windowsIdentity = this.authProvider.logonUser(auth.getName(), auth.getCredentials().toString());
} catch (final Win32Exception e) {
throw new AuthenticationServiceException(e.getMessage(), e);
}
WindowsAuthenticationProvider.LOGGER.debug("logged in user: {} ({})", windowsIdentity.getFqn(),
windowsIdentity.getSidString());
if (!this.allowGuestLogin && windowsIdentity.isGuest()) {
WindowsAuthenticationProvider.LOGGER.warn("guest login disabled: {}", windowsIdentity.getFqn());
throw new GuestLoginDisabledAuthenticationException(windowsIdentity.getFqn());
}
final WindowsPrincipal windowsPrincipal = new WindowsPrincipal(windowsIdentity, this.principalFormat,
this.roleFormat);
WindowsAuthenticationProvider.LOGGER.debug("roles: {}", windowsPrincipal.getRolesString());
final WindowsAuthenticationToken token = new WindowsAuthenticationToken(windowsPrincipal,
this.grantedAuthorityFactory, this.defaultGrantedAuthority);
WindowsAuthenticationProvider.LOGGER.info("successfully logged in user: {}", windowsIdentity.getFqn());
return token;
}
代码示例来源:origin: com.github.waffle/waffle-spring-security3
@Override
public Authentication authenticate(final Authentication authentication) {
final UsernamePasswordAuthenticationToken auth = (UsernamePasswordAuthenticationToken) authentication;
IWindowsIdentity windowsIdentity;
try {
windowsIdentity = this.authProvider.logonUser(auth.getName(), auth.getCredentials().toString());
} catch (final Win32Exception e) {
throw new AuthenticationServiceException(e.getMessage(), e);
}
WindowsAuthenticationProvider.LOGGER.debug("logged in user: {} ({})", windowsIdentity.getFqn(),
windowsIdentity.getSidString());
if (!this.allowGuestLogin && windowsIdentity.isGuest()) {
WindowsAuthenticationProvider.LOGGER.warn("guest login disabled: {}", windowsIdentity.getFqn());
throw new GuestLoginDisabledAuthenticationException(windowsIdentity.getFqn());
}
final WindowsPrincipal windowsPrincipal = new WindowsPrincipal(windowsIdentity, this.principalFormat,
this.roleFormat);
WindowsAuthenticationProvider.LOGGER.debug("roles: {}", windowsPrincipal.getRolesString());
final WindowsAuthenticationToken token = new WindowsAuthenticationToken(windowsPrincipal,
this.grantedAuthorityFactory, this.defaultGrantedAuthority);
WindowsAuthenticationProvider.LOGGER.info("successfully logged in user: {}", windowsIdentity.getFqn());
return token;
}
log.debug("roles: " + windowsPrincipal.getRolesString());
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.application.authenticator.iwa
log.debug("roles: " + windowsPrincipal.getRolesString());
内容来源于网络,如有侵权,请联系作者删除!