Search in sources :

Example 1 with AuthSPrincipal

use of com.sun.identity.authentication.internal.server.AuthSPrincipal in project OpenAM by OpenRock.

the class SSOTokenPrincipal method createSubject.

public Subject createSubject() throws Exception {
    Set<Principal> userPrincipals = new HashSet<Principal>(2);
    String uuid = ssoToken.getProperty(Constants.UNIVERSAL_IDENTIFIER);
    userPrincipals.add(new AuthSPrincipal(uuid));
    Set privateCred = new HashSet();
    privateCred.add(ssoToken);
    return new Subject(false, userPrincipals, new HashSet(), privateCred);
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) AuthSPrincipal(com.sun.identity.authentication.internal.server.AuthSPrincipal) Principal(java.security.Principal) AuthSPrincipal(com.sun.identity.authentication.internal.server.AuthSPrincipal) Subject(javax.security.auth.Subject) HashSet(java.util.HashSet)

Example 2 with AuthSPrincipal

use of com.sun.identity.authentication.internal.server.AuthSPrincipal in project OpenAM by OpenRock.

the class ProxyPETest method createSubject.

private javax.security.auth.Subject createSubject(SSOToken token) {
    Principal userP = new AuthSPrincipal(token.getTokenID().toString());
    Set userPrincipals = new HashSet(2);
    userPrincipals.add(userP);
    return new javax.security.auth.Subject(true, userPrincipals, Collections.EMPTY_SET, Collections.EMPTY_SET);
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) AuthSPrincipal(com.sun.identity.authentication.internal.server.AuthSPrincipal) Principal(java.security.Principal) AuthSPrincipal(com.sun.identity.authentication.internal.server.AuthSPrincipal) Subject(com.sun.identity.policy.interfaces.Subject) HashSet(java.util.HashSet)

Example 3 with AuthSPrincipal

use of com.sun.identity.authentication.internal.server.AuthSPrincipal in project OpenAM by OpenRock.

the class SubjectUtils method createSubject.

public static Subject createSubject(SSOToken token) {
    try {
        Set<Principal> userPrincipals = new HashSet<Principal>(2);
        String uuid = token.getProperty(Constants.UNIVERSAL_IDENTIFIER);
        userPrincipals.add(new AuthSPrincipal(uuid));
        Set privateCred = new HashSet();
        privateCred.add(token);
        return new Subject(false, userPrincipals, new HashSet(), privateCred);
    } catch (SSOException ex) {
        PolicyConstants.DEBUG.error("SubjectUtils.createSubject", ex);
        return null;
    }
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) AuthSPrincipal(com.sun.identity.authentication.internal.server.AuthSPrincipal) SSOException(com.iplanet.sso.SSOException) Principal(java.security.Principal) AuthSPrincipal(com.sun.identity.authentication.internal.server.AuthSPrincipal) Subject(javax.security.auth.Subject) HashSet(java.util.HashSet)

Example 4 with AuthSPrincipal

use of com.sun.identity.authentication.internal.server.AuthSPrincipal in project OpenAM by OpenRock.

the class LogTest method createSubject.

private Subject createSubject(SSOToken token) {
    Principal userP = new AuthSPrincipal(token.getTokenID().toString());
    Set userPrincipals = new HashSet(2);
    userPrincipals.add(userP);
    Set privateCred = new HashSet(2);
    privateCred.add(token);
    return new Subject(true, userPrincipals, Collections.EMPTY_SET, privateCred);
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) AuthSPrincipal(com.sun.identity.authentication.internal.server.AuthSPrincipal) Principal(java.security.Principal) AuthSPrincipal(com.sun.identity.authentication.internal.server.AuthSPrincipal) Subject(javax.security.auth.Subject) HashSet(java.util.HashSet)

Example 5 with AuthSPrincipal

use of com.sun.identity.authentication.internal.server.AuthSPrincipal in project OpenAM by OpenRock.

the class SubRealmGroupTest method createSubject.

public static Subject createSubject(String uuid) {
    Set<Principal> userPrincipals = new HashSet<Principal>(2);
    userPrincipals.add(new AuthSPrincipal(uuid));
    return new Subject(false, userPrincipals, new HashSet(), new HashSet());
}
Also used : AuthSPrincipal(com.sun.identity.authentication.internal.server.AuthSPrincipal) Principal(java.security.Principal) AuthSPrincipal(com.sun.identity.authentication.internal.server.AuthSPrincipal) Subject(javax.security.auth.Subject) HashSet(java.util.HashSet)

Aggregations

AuthSPrincipal (com.sun.identity.authentication.internal.server.AuthSPrincipal)8 Principal (java.security.Principal)8 HashSet (java.util.HashSet)8 Set (java.util.Set)6 Subject (javax.security.auth.Subject)6 SSOException (com.iplanet.sso.SSOException)2 Subject (com.sun.identity.policy.interfaces.Subject)2 SSOToken (com.iplanet.sso.SSOToken)1 AttributeLookupCondition (com.sun.identity.entitlement.AttributeLookupCondition)1 Entitlement (com.sun.identity.entitlement.Entitlement)1 EntitlementException (com.sun.identity.entitlement.EntitlementException)1 Evaluator (com.sun.identity.entitlement.Evaluator)1 UserSubject (com.sun.identity.entitlement.UserSubject)1 OpenSSOUserSubject (com.sun.identity.entitlement.opensso.OpenSSOUserSubject)1 IdRepoException (com.sun.identity.idm.IdRepoException)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Test (org.testng.annotations.Test)1