use of com.epam.pipeline.security.jwt.JwtAuthenticationToken in project cloud-pipeline by epam.
the class AuthManager method createSchedulerSecurityContext.
/**
* @return A default UserContext for scheduled operations
*/
public SecurityContext createSchedulerSecurityContext() {
SecurityContext context = SecurityContextHolder.createEmptyContext();
UserContext userContext = new UserContext(defaultAdminId, defaultAdmin);
Collection<GrantedAuthority> authorities = AuthorityUtils.createAuthorityList("ROLE_ADMIN");
context.setAuthentication(new JwtAuthenticationToken(userContext, authorities));
return context;
}
Aggregations