Package org.apache.oodt.security.sso.opensso

Examples of org.apache.oodt.security.sso.opensso.UserDetails


    if (cookieVal == null) {
      // let's try and get the SSO token
      // and pull the username from there
      String ssoToken = this.getSSOToken();
      if (ssoToken != null) {
        UserDetails details = null;
        try {
          details = this.ssoProxy.getUserAttributes(ssoToken);
        } catch (Exception e) {
          e.printStackTrace();
          return UNKNOWN_USER;
        }
        return details.getAttributes().getMetadata(UID_ATTRIBUTE_NAME) != null ? details
            .getAttributes().getMetadata(UID_ATTRIBUTE_NAME) : UNKNOWN_USER;
      } else
        return UNKNOWN_USER;
    } else {
      return new String(Base64.decodeBase64(cookieVal.getBytes()));
View Full Code Here


  public List<String> getGroupsForUser() throws Exception {
    String token = this.getSSOToken();
    if (token == null) {
      return Collections.EMPTY_LIST;
    } else {
      UserDetails details = this.ssoProxy.getUserAttributes(token);
      // groups are formatted in this response to include whole
      // principals, like lmmp-infra,...principal
      // so split on "," and take the first token to get the group name
      List<String> groups = new Vector<String>();
      for (String rawGroup : details.getRoles()) {
        groups.add(rawGroup.split(",")[0]);
      }

      return groups;
    }
View Full Code Here

TOP

Related Classes of org.apache.oodt.security.sso.opensso.UserDetails

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.