All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jaaslounge.AuthenticatedUser Maven / Gradle / Ivy

There is a newer version: 0.2.0
Show newest version
package org.jaaslounge;

import java.util.ArrayList;
import java.util.List;

public class AuthenticatedUser {

    public static final String SESSION_ATTRIBUTE_NAME = "org.org.jaaslounge.sso.user";

    private String name;
    private String domain;
    private List groups;

    public AuthenticatedUser(String name, String domain, List groups) {
        String username = name;
        String userdomain = domain;
        if(name.contains("@") && domain == null) {
            String[] split = name.split("@");
            if(split.length > 0)
                username = split[0];
            if(split.length > 1)
                userdomain = split[1];
        }

        this.name = username;
        this.domain = userdomain;
        this.groups = groups;
    }

    public AuthenticatedUser(String name, String domain) {
        this(name, domain, new ArrayList());
    }

    public AuthenticatedUser(String name) {
        this(name, null, new ArrayList());
    }

    public String getName() {
        return name;
    }

    public String getDomain() {
        return domain;
    }

    public List getGroups() {
        return groups;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy