本文整理汇总了Java中gov.nih.nci.security.AuthenticationManager类的典型用法代码示例。如果您正苦于以下问题:Java AuthenticationManager类的具体用法?Java AuthenticationManager怎么用?Java AuthenticationManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AuthenticationManager类属于gov.nih.nci.security包,在下文中一共展示了AuthenticationManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleWebServiceRequest
import gov.nih.nci.security.AuthenticationManager; //导入依赖的package包/类
public Object handleWebServiceRequest(Object request) throws Exception
{
CacheManager cacheManager = CacheManager.getInstance();
boolean loginResult = false;
LoginRequest loginRequest = (LoginRequest)request;
String applicationContext = loginRequest.getApplicationContext();
String userName = loginRequest.getUserName();
String password = loginRequest.getPassword();
AuthenticationManager authenticationManager = cacheManager.getAuthenticationManager(applicationContext);
loginResult = authenticationManager.login(userName,password);
LoginResponse loginResponse = new LoginResponse();
loginResponse.setResult(loginResult);
return loginResponse;
}
示例2: getSubject
import gov.nih.nci.security.AuthenticationManager; //导入依赖的package包/类
public Subject getSubject(Credential credential)
throws InvalidCredentialException {
Subject subject = null;
AuthenticationManager mgr = getAuthenticationManager();
if (credential instanceof BasicAuthentication) {
try {
BasicAuthentication bac = (BasicAuthentication) credential;
// System.out.println("Checking: userId=" + bac.getUserId() + ",
// password=" + bac.getPassword());
subject = mgr.authenticate(bac.getUserId(), bac.getPassword());
} catch (CSException ex) {
throw new InvalidCredentialException(
"Invalid userid or password!", ex);
}
return subject;
} else {
throw new InvalidCredentialException(
"The credential type submitted is not supported by this service.");
}
}
示例3: localAuthenticate
import gov.nih.nci.security.AuthenticationManager; //导入依赖的package包/类
/**
* Authenticates the username and password using the Common Security Module
*
* @param username
* @param password
* @return
*/
private boolean localAuthenticate(String username, String password) throws AuthenticationException{
AuthenticationManager am = null;
boolean loggedIn = false;
try {
/**
* TODO get application Ccontext from system properties
*/
am = SecurityServiceProvider.getAuthenticationManager(application);
loggedIn = am.login(username, password);
} catch (CSException e) {
throw new AuthenticationException("User Name or Password is not correct");
}
return loggedIn;
}
示例4: login
import gov.nih.nci.security.AuthenticationManager; //导入依赖的package包/类
/**
* Returns true or false depending on the person gets authenticated or not.
* @param requestingClass
* @param loginName login name
* @param password password
* @return @throws CSException
*/
public boolean login(String loginName, String password) throws SMException
{
boolean loginSuccess = false;
try
{
Logger.out.debug("login name: " + loginName + " passowrd: " + password);
AuthenticationManager authMngr = getAuthenticationManager();
loginSuccess = authMngr.login(loginName, password);
}
catch (CSException ex)
{
Logger.out.debug("Authentication|"
+ requestingClass
+ "|"
+ loginName
+ "|login|Success| Authentication is not successful for user "
+ loginName + "|" + ex.getMessage());
throw new SMException(ex.getMessage(), ex);
}
return loginSuccess;
}
示例5: getAuthenticationManagerLDAP
import gov.nih.nci.security.AuthenticationManager; //导入依赖的package包/类
private AuthenticationManager getAuthenticationManagerLDAP(){
if (authenticationManagerLdap == null )
{
try
{
authenticationManagerLdap = SecurityServiceProvider.getAuthenticationManager("LDAPGRID");
}
catch (CSException e)
{
fail();
}
}
return authenticationManagerLdap;
}
示例6: getAuthenticationManagerRDBMS
import gov.nih.nci.security.AuthenticationManager; //导入依赖的package包/类
private AuthenticationManager getAuthenticationManagerRDBMS(){
if (authenticationManagerRDBMS == null )
{
try
{
authenticationManagerRDBMS = SecurityServiceProvider.getAuthenticationManager("RDBMSGRID");
}
catch (CSException e)
{
fail();
}
}
return authenticationManagerRDBMS;
}
示例7: getAuthenticationManagerLDAP
import gov.nih.nci.security.AuthenticationManager; //导入依赖的package包/类
private AuthenticationManager getAuthenticationManagerLDAP(){
if (authenticationManagerLdap == null )
{
try
{
authenticationManagerLdap = SecurityServiceProvider.getAuthenticationManager("LDAPGRID");
}
catch (CSException e)
{
fail("\nFailer in obtaining Authentication Manager for LDAPGRID\n");
}
}
return authenticationManagerLdap;
}
示例8: getAuthenticationManagerRDBMS
import gov.nih.nci.security.AuthenticationManager; //导入依赖的package包/类
private AuthenticationManager getAuthenticationManagerRDBMS(){
if (authenticationManagerRDBMS == null )
{
try
{
authenticationManagerRDBMS = SecurityServiceProvider.getAuthenticationManager("RDBMSGRID");
}
catch (CSException e)
{
fail("\nFailer in obtaining Authentication Manager for RDBMSGRID\n");
}
}
return authenticationManagerRDBMS;
}
示例9: getAuthenticationManagerOpenLDAP
import gov.nih.nci.security.AuthenticationManager; //导入依赖的package包/类
private AuthenticationManager getAuthenticationManagerOpenLDAP(){
if (authenticationManagerOpenLdap == null )
{
try
{
authenticationManagerOpenLdap = SecurityServiceProvider.getAuthenticationManager("sdk");
}
catch (CSException e)
{
fail();
}
}
return authenticationManagerOpenLdap;
}
示例10: getAuthenticationManagerOpenLDAP
import gov.nih.nci.security.AuthenticationManager; //导入依赖的package包/类
private AuthenticationManager getAuthenticationManagerOpenLDAP(){
if (authenticationManagerOpenLdap == null )
{
try
{
authenticationManagerOpenLdap = SecurityServiceProvider.getAuthenticationManager("OpenLDAP");
}
catch (CSException e)
{
fail();
}
}
return authenticationManagerOpenLdap;
}
示例11: getAuthenticationManagerEDirectory
import gov.nih.nci.security.AuthenticationManager; //导入依赖的package包/类
private AuthenticationManager getAuthenticationManagerEDirectory(){
if (authenticationManagerEDirectory == null )
{
try
{
authenticationManagerEDirectory = SecurityServiceProvider.getAuthenticationManager("EDirectory");
}
catch (CSException e)
{
fail();
}
}
return authenticationManagerEDirectory;
}
示例12: getAuthenticationManagerCLM
import gov.nih.nci.security.AuthenticationManager; //导入依赖的package包/类
private AuthenticationManager getAuthenticationManagerCLM(){
if (authenticationManagerCLM == null )
{
try
{
authenticationManagerCLM = SecurityServiceProvider.getAuthenticationManager("CLM");
}
catch (CSException e)
{
fail();
}
}
return authenticationManagerCLM;
}
示例13: getauthenticationManagerX509
import gov.nih.nci.security.AuthenticationManager; //导入依赖的package包/类
private AuthenticationManager getauthenticationManagerX509()
{
if (authenticationManagerX509 == null )
{
try
{
authenticationManagerX509 = SecurityServiceProvider.getAuthenticationManager("X509");
}
catch (CSException e)
{
fail();
}
}
return authenticationManagerX509;
}
示例14: getauthenticationManagerX509
import gov.nih.nci.security.AuthenticationManager; //导入依赖的package包/类
private AuthenticationManager getauthenticationManagerX509(){
if (authenticationManagerX509 == null )
{
try
{
authenticationManagerX509 = SecurityServiceProvider.getAuthenticationManager("X509");
}
catch (CSException e)
{
fail();
}
}
return authenticationManagerX509;
}
示例15: getAuthenticationManager
import gov.nih.nci.security.AuthenticationManager; //导入依赖的package包/类
/**
* Returns the AuthenticationManager for the CSM RI. This method follows the
* singleton pattern so that only one AuthenticationManager is created for
* the CSM RI.
*
* @return
* @throws CSException
*/
protected AuthenticationManager getAuthenticationManager()
throws CSException {
if (authMgr == null) {
synchronized (LoginAction.class) {
if (authMgr == null) {
authMgr = SecurityServiceProvider
.getAuthenticationManager(CSM_RI_CONTEXT_NAME);
}
}
}
return authMgr;
}