waffle.servlet.WindowsPrincipal.getRolesString()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(8.3k)|赞(0)|评价(0)|浏览(176)

本文整理了Java中waffle.servlet.WindowsPrincipal.getRolesString()方法的一些代码示例,展示了WindowsPrincipal.getRolesString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WindowsPrincipal.getRolesString()方法的具体详情如下:
包路径:waffle.servlet.WindowsPrincipal
类名称:WindowsPrincipal
方法名:getRolesString

WindowsPrincipal.getRolesString介绍

[英]Get an array of roles as a string.
[中]以字符串形式获取角色数组。

代码示例

代码示例来源:origin: salyh/elasticsearch-security-plugin

  1. public List<String> getUserRoles() {
  2. if (request.getUserPrincipal() instanceof GenericPrincipal) {
  3. final GenericPrincipal wp = (GenericPrincipal) request
  4. .getUserPrincipal();
  5. if (wp.getRoles() != null) {
  6. final List<String> roles = Arrays.asList(wp.getRoles());
  7. log.debug("GenericPrincipal roles: " + roles);
  8. return roles;
  9. }
  10. }
  11. if (request.getUserPrincipal() instanceof WindowsPrincipal) {
  12. final WindowsPrincipal wp = (WindowsPrincipal) request
  13. .getUserPrincipal();
  14. log.debug("WindowsPrincipal roles: " + wp.getRolesString());
  15. log.debug("WindowsPrincipal groups: " + wp.getGroups());
  16. if (wp.getRolesString() != null) {
  17. return Arrays.asList(wp.getRolesString().split(","));
  18. }
  19. }
  20. /*if (this.request.getUserPrincipal() instanceof ActiveDirectoryPrincipal) {
  21. final ActiveDirectoryPrincipal ap = (ActiveDirectoryPrincipal) this.request
  22. .getUserPrincipal();
  23. log.debug("ActiveDirectoryPrincipal roles: " + ap.getRoles());
  24. return ap.getRoles();
  25. }*/
  26. return null;
  27. }

代码示例来源:origin: com.github.waffle/waffle-jna

  1. NegotiateSecurityFilter.LOGGER.debug("roles: {}", windowsPrincipal.getRolesString());
  2. subject.getPrincipals().add(windowsPrincipal);
  3. request.getSession(false).setAttribute("javax.security.auth.subject", subject);

代码示例来源:origin: Waffle/waffle

  1. NegotiateSecurityFilter.LOGGER.debug("roles: {}", windowsPrincipal.getRolesString());
  2. subject.getPrincipals().add(windowsPrincipal);
  3. request.getSession(false).setAttribute("javax.security.auth.subject", subject);

代码示例来源:origin: com.github.dblock.waffle/waffle-jna

  1. NegotiateSecurityFilter.LOGGER.debug("roles: {}", windowsPrincipal.getRolesString());
  2. subject.getPrincipals().add(windowsPrincipal);
  3. session.setAttribute("javax.security.auth.subject", subject);

代码示例来源:origin: com.github.dblock.waffle/waffle-spring-security4

  1. @Override
  2. public Authentication authenticate(final Authentication authentication) {
  3. final UsernamePasswordAuthenticationToken auth = (UsernamePasswordAuthenticationToken) authentication;
  4. final IWindowsIdentity windowsIdentity = this.authProvider.logonUser(auth.getName(), auth.getCredentials()
  5. .toString());
  6. WindowsAuthenticationProvider.LOGGER.debug("logged in user: {} ({})", windowsIdentity.getFqn(),
  7. windowsIdentity.getSidString());
  8. if (!this.allowGuestLogin && windowsIdentity.isGuest()) {
  9. WindowsAuthenticationProvider.LOGGER.warn("guest login disabled: {}", windowsIdentity.getFqn());
  10. throw new GuestLoginDisabledAuthenticationException(windowsIdentity.getFqn());
  11. }
  12. final WindowsPrincipal windowsPrincipal = new WindowsPrincipal(windowsIdentity, this.principalFormat,
  13. this.roleFormat);
  14. WindowsAuthenticationProvider.LOGGER.debug("roles: {}", windowsPrincipal.getRolesString());
  15. final WindowsAuthenticationToken token = new WindowsAuthenticationToken(windowsPrincipal,
  16. this.grantedAuthorityFactory, this.defaultGrantedAuthority);
  17. WindowsAuthenticationProvider.LOGGER.info("successfully logged in user: {}", windowsIdentity.getFqn());
  18. return token;
  19. }

代码示例来源:origin: com.github.dblock.waffle/waffle-spring-security4

  1. this.principalFormat, this.roleFormat);
  2. NegotiateSecurityFilter.LOGGER.debug("roles: {}", principal.getRolesString());

代码示例来源:origin: Waffle/waffle

  1. : new WindowsPrincipal(windowsIdentity, this.principalFormat, this.roleFormat);
  2. NegotiateSecurityFilter.LOGGER.debug("roles: {}", principal.getRolesString());

代码示例来源:origin: Waffle/waffle

  1. @Override
  2. public Authentication authenticate(final Authentication authentication) {
  3. final UsernamePasswordAuthenticationToken auth = (UsernamePasswordAuthenticationToken) authentication;
  4. IWindowsIdentity windowsIdentity;
  5. try {
  6. windowsIdentity = this.authProvider.logonUser(auth.getName(), auth.getCredentials().toString());
  7. } catch (final Win32Exception e) {
  8. throw new AuthenticationServiceException(e.getMessage(), e);
  9. }
  10. WindowsAuthenticationProvider.LOGGER.debug("logged in user: {} ({})", windowsIdentity.getFqn(),
  11. windowsIdentity.getSidString());
  12. if (!this.allowGuestLogin && windowsIdentity.isGuest()) {
  13. WindowsAuthenticationProvider.LOGGER.warn("guest login disabled: {}", windowsIdentity.getFqn());
  14. throw new GuestLoginDisabledAuthenticationException(windowsIdentity.getFqn());
  15. }
  16. final WindowsPrincipal windowsPrincipal = new WindowsPrincipal(windowsIdentity, this.principalFormat,
  17. this.roleFormat);
  18. WindowsAuthenticationProvider.LOGGER.debug("roles: {}", windowsPrincipal.getRolesString());
  19. final WindowsAuthenticationToken token = new WindowsAuthenticationToken(windowsPrincipal,
  20. this.grantedAuthorityFactory, this.defaultGrantedAuthority);
  21. WindowsAuthenticationProvider.LOGGER.info("successfully logged in user: {}", windowsIdentity.getFqn());
  22. return token;
  23. }

代码示例来源:origin: com.github.waffle/waffle-spring-security3

  1. : new WindowsPrincipal(windowsIdentity, this.principalFormat, this.roleFormat);
  2. NegotiateSecurityFilter.LOGGER.debug("roles: {}", principal.getRolesString());

代码示例来源:origin: Waffle/waffle

  1. : new WindowsPrincipal(windowsIdentity, this.principalFormat, this.roleFormat);
  2. NegotiateSecurityFilter.LOGGER.debug("roles: {}", principal.getRolesString());

代码示例来源:origin: Waffle/waffle

  1. @Override
  2. public Authentication authenticate(final Authentication authentication) {
  3. final UsernamePasswordAuthenticationToken auth = (UsernamePasswordAuthenticationToken) authentication;
  4. IWindowsIdentity windowsIdentity;
  5. try {
  6. windowsIdentity = this.authProvider.logonUser(auth.getName(), auth.getCredentials().toString());
  7. } catch (final Win32Exception e) {
  8. throw new AuthenticationServiceException(e.getMessage(), e);
  9. }
  10. WindowsAuthenticationProvider.LOGGER.debug("logged in user: {} ({})", windowsIdentity.getFqn(),
  11. windowsIdentity.getSidString());
  12. if (!this.allowGuestLogin && windowsIdentity.isGuest()) {
  13. WindowsAuthenticationProvider.LOGGER.warn("guest login disabled: {}", windowsIdentity.getFqn());
  14. throw new GuestLoginDisabledAuthenticationException(windowsIdentity.getFqn());
  15. }
  16. final WindowsPrincipal windowsPrincipal = new WindowsPrincipal(windowsIdentity, this.principalFormat,
  17. this.roleFormat);
  18. WindowsAuthenticationProvider.LOGGER.debug("roles: {}", windowsPrincipal.getRolesString());
  19. final WindowsAuthenticationToken token = new WindowsAuthenticationToken(windowsPrincipal,
  20. this.grantedAuthorityFactory, this.defaultGrantedAuthority);
  21. WindowsAuthenticationProvider.LOGGER.info("successfully logged in user: {}", windowsIdentity.getFqn());
  22. return token;
  23. }

代码示例来源:origin: com.github.waffle/waffle-spring-security3

  1. @Override
  2. public Authentication authenticate(final Authentication authentication) {
  3. final UsernamePasswordAuthenticationToken auth = (UsernamePasswordAuthenticationToken) authentication;
  4. IWindowsIdentity windowsIdentity;
  5. try {
  6. windowsIdentity = this.authProvider.logonUser(auth.getName(), auth.getCredentials().toString());
  7. } catch (final Win32Exception e) {
  8. throw new AuthenticationServiceException(e.getMessage(), e);
  9. }
  10. WindowsAuthenticationProvider.LOGGER.debug("logged in user: {} ({})", windowsIdentity.getFqn(),
  11. windowsIdentity.getSidString());
  12. if (!this.allowGuestLogin && windowsIdentity.isGuest()) {
  13. WindowsAuthenticationProvider.LOGGER.warn("guest login disabled: {}", windowsIdentity.getFqn());
  14. throw new GuestLoginDisabledAuthenticationException(windowsIdentity.getFqn());
  15. }
  16. final WindowsPrincipal windowsPrincipal = new WindowsPrincipal(windowsIdentity, this.principalFormat,
  17. this.roleFormat);
  18. WindowsAuthenticationProvider.LOGGER.debug("roles: {}", windowsPrincipal.getRolesString());
  19. final WindowsAuthenticationToken token = new WindowsAuthenticationToken(windowsPrincipal,
  20. this.grantedAuthorityFactory, this.defaultGrantedAuthority);
  21. WindowsAuthenticationProvider.LOGGER.info("successfully logged in user: {}", windowsIdentity.getFqn());
  22. return token;
  23. }

代码示例来源:origin: org.wso2.carbon.identity.application.auth.iwa.ntlm/org.wso2.carbon.identity.application.authenticator.iwa.ntlm

  1. log.debug("roles: " + windowsPrincipal.getRolesString());

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.application.authenticator.iwa

  1. log.debug("roles: " + windowsPrincipal.getRolesString());

相关文章