KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > atlassian > seraph > util > SecurityUtils


1 package com.atlassian.seraph.util;
2
3 import org.apache.log4j.Category;
4
5 import javax.servlet.ServletContext JavaDoc;
6
7 import com.atlassian.seraph.config.SecurityConfig;
8 import com.atlassian.seraph.auth.Authenticator;
9
10 public class SecurityUtils
11 {
12     private static final Category log = Category.getInstance(SecurityUtils.class);
13
14     public static Authenticator getAuthenticator(ServletContext JavaDoc servletContext)
15     {
16         SecurityConfig securityConfig = (SecurityConfig) servletContext.getAttribute(SecurityConfig.STORAGE_KEY);
17
18         if (securityConfig.getAuthenticator() == null)
19         {
20             log.error("ack! Authenticator is null!!!");
21         }
22
23         return securityConfig.getAuthenticator();
24     }
25 }
26
Popular Tags