Search in sources :

Example 1 with UserAuthentication

use of io.pivotal.cla.security.Login.UserAuthentication in project pivotal-cla by pivotalsoftware.

the class WithSigningUserFactory method createSecurityContext.

@Override
public SecurityContext createSecurityContext(WithSigningUser user) {
    User principal = create();
    principal.setAdminAccessRequested(user.requestedAdmin());
    UserAuthentication auth = new UserAuthentication(principal);
    SecurityContext context = SecurityContextHolder.createEmptyContext();
    context.setAuthentication(auth);
    return context;
}
Also used : User(io.pivotal.cla.data.User) SecurityContext(org.springframework.security.core.context.SecurityContext) UserAuthentication(io.pivotal.cla.security.Login.UserAuthentication)

Example 2 with UserAuthentication

use of io.pivotal.cla.security.Login.UserAuthentication in project pivotal-cla by pivotalsoftware.

the class WithClaAuthorUserFactory method createSecurityContext.

@Override
public SecurityContext createSecurityContext(WithClaAuthorUser user) {
    User adminUser = create();
    UserAuthentication auth = new UserAuthentication(adminUser);
    SecurityContext context = SecurityContextHolder.createEmptyContext();
    context.setAuthentication(auth);
    return context;
}
Also used : User(io.pivotal.cla.data.User) SecurityContext(org.springframework.security.core.context.SecurityContext) UserAuthentication(io.pivotal.cla.security.Login.UserAuthentication)

Example 3 with UserAuthentication

use of io.pivotal.cla.security.Login.UserAuthentication in project pivotal-cla by pivotalsoftware.

the class WithAdminUserFactory method createSecurityContext.

@Override
public SecurityContext createSecurityContext(WithAdminUser user) {
    User adminUser = create();
    UserAuthentication auth = new UserAuthentication(adminUser);
    SecurityContext context = SecurityContextHolder.createEmptyContext();
    context.setAuthentication(auth);
    return context;
}
Also used : User(io.pivotal.cla.data.User) SecurityContext(org.springframework.security.core.context.SecurityContext) UserAuthentication(io.pivotal.cla.security.Login.UserAuthentication)

Aggregations

User (io.pivotal.cla.data.User)3 UserAuthentication (io.pivotal.cla.security.Login.UserAuthentication)3 SecurityContext (org.springframework.security.core.context.SecurityContext)3