当前位置: 首页>>代码示例>>Java>>正文


Java AuthenticationManager类代码示例

本文整理汇总了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;
}
 
开发者ID:NCIP,项目名称:common-security-module,代码行数:21,代码来源:AuthenticationWebServiceRequestHandler.java

示例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.");
	}
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:21,代码来源:DefaultSubjectProvider.java

示例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;
}
 
开发者ID:NCIP,项目名称:stats-application-commons,代码行数:25,代码来源:SecurityManager.java

示例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;
}
 
开发者ID:NCIP,项目名称:wustl-common-package,代码行数:29,代码来源:SecurityManager.java

示例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;
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:15,代码来源:GridAuthenticationTest.java

示例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;
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:15,代码来源:GridAuthenticationTest.java

示例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;
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:15,代码来源:QAGridAuthenticationTest.java

示例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;
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:15,代码来源:QAGridAuthenticationTest.java

示例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;
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:15,代码来源:AuthenicationManagerTest.java

示例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;
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:15,代码来源:AuthenicationManagerTest.java

示例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;
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:15,代码来源:AuthenicationManagerTest.java

示例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;
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:15,代码来源:AuthenicationManagerTest.java

示例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;
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:16,代码来源:QACertificateAuthenicationManagerTest.java

示例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;
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:15,代码来源:CertificateAuthenicationManagerTest.java

示例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;

}
 
开发者ID:NCIP,项目名称:common-security-module,代码行数:23,代码来源:LoginAction.java


注:本文中的gov.nih.nci.security.AuthenticationManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。