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


Java CredentialsSource类代码示例

本文整理汇总了Java中org.kuali.rice.core.api.security.credentials.CredentialsSource的典型用法代码示例。如果您正苦于以下问题:Java CredentialsSource类的具体用法?Java CredentialsSource怎么用?Java CredentialsSource使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CredentialsSource类属于org.kuali.rice.core.api.security.credentials包,在下文中一共展示了CredentialsSource类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CredentialsOutHandler

import org.kuali.rice.core.api.security.credentials.CredentialsSource; //导入依赖的package包/类
public CredentialsOutHandler(final CredentialsSource credentialsSource,
		final ServiceConfiguration serviceConfiguration) {
	Assert.notNull(credentialsSource, "credentialsSource cannot be null.");
	Assert.notNull(serviceConfiguration, "serviceConfiguration cannot be null.");
	this.credentialsSource = credentialsSource;
	this.serviceConfiguration = serviceConfiguration;

	final Credentials credentials = this.credentialsSource
			.getCredentials(this.serviceConfiguration.getEndpointUrl().toString());

	Assert.isTrue(credentials instanceof UsernamePasswordCredentials,
			"Credentials must be of type usernamepassword.");

	final UsernamePasswordCredentials c = (UsernamePasswordCredentials) credentials;
	setProperty(WSHandlerConstants.USER, c.getUsername());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:CredentialsOutHandler.java

示例2: registerTestCredentialsSourceFactory

import org.kuali.rice.core.api.security.credentials.CredentialsSource; //导入依赖的package包/类
/**
 * Registers a CredentialsSourceFactory with our ConfigContext.  Needed to verify that services requiring basic auth
 * work.
 */
private void registerTestCredentialsSourceFactory() {
    List<CredentialsSource> credentialsSources =
            Collections.<CredentialsSource>singletonList(
                    new UsernamePasswordCredentialsSource("gilesp", "thuperthecret"));

    CredentialsSourceFactory credentialsSourceFactory = new CredentialsSourceFactory();
    credentialsSourceFactory.setCredentialsSources(credentialsSources);

    try {
        credentialsSourceFactory.afterPropertiesSet();
    } catch (Exception e) {
        throw new RiceRuntimeException(e);
    }

    ConfigContext.getCurrentContextConfig().putObject(Config.CREDENTIALS_SOURCE_FACTORY, credentialsSourceFactory);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:TestClient1.java

示例3: AuthenticationCommonsHttpInvokerRequestExecutor

import org.kuali.rice.core.api.security.credentials.CredentialsSource; //导入依赖的package包/类
/**
 * Constructor that accepts the CredentialsSource and Service Info.
 *
 * @param httpClient the http client
 * @param credentialsSource the source of credentials.
 * @param serviceConfiguration the service configuration.
 */
public AuthenticationCommonsHttpInvokerRequestExecutor(final HttpClient httpClient,
    final CredentialsSource credentialsSource, final ServiceConfiguration serviceConfiguration) {
    super(httpClient);
    Assert.notNull(credentialsSource, "credentialsSource cannot be null.");
    Assert.notNull(serviceConfiguration, "serviceConfiguration cannot be null.");
    this.credentialsSource = credentialsSource;
    this.serviceConfiguration = serviceConfiguration;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:16,代码来源:AuthenticationCommonsHttpInvokerRequestExecutor.java

示例4: AuthenticationCommonsHttpInvokerRequestExecutor

import org.kuali.rice.core.api.security.credentials.CredentialsSource; //导入依赖的package包/类
/**
 * Constructor that accepts the CredentialsSource and Service Info.
 * 
 * @param credentialsSource the source of credentials.
 * @param serviceInfo information about the service.
 */
public AuthenticationCommonsHttpInvokerRequestExecutor(final HttpClient httpClient, 
    final CredentialsSource credentialsSource, final ServiceConfiguration serviceConfiguration) {
    super(httpClient);
    Assert.notNull(credentialsSource, "credentialsSource cannot be null.");
    Assert.notNull(serviceConfiguration, "serviceConfiguration cannot be null.");
    this.credentialsSource = credentialsSource;
    this.serviceConfiguration = serviceConfiguration;
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:15,代码来源:AuthenticationCommonsHttpInvokerRequestExecutor.java

示例5: setCredentialsSource

import org.kuali.rice.core.api.security.credentials.CredentialsSource; //导入依赖的package包/类
public void setCredentialsSource(final CredentialsSource credentialsSource) {
	this.credentialsSource = credentialsSource;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:4,代码来源:ResourceFacadeImpl.java

示例6: getCredentialsSource

import org.kuali.rice.core.api.security.credentials.CredentialsSource; //导入依赖的package包/类
protected CredentialsSource getCredentialsSource() {
	return this.credentialsSource;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:4,代码来源:ResourceFacadeImpl.java

示例7: getServiceConnector

import org.kuali.rice.core.api.security.credentials.CredentialsSource; //导入依赖的package包/类
public static ServiceConnector getServiceConnector(
		final ServiceConfiguration serviceConfiguration) {
	final CredentialsSourceFactory credentialsSourceFactory = (CredentialsSourceFactory) ConfigContext
			.getCurrentContextConfig().getObjects()
			.get(Config.CREDENTIALS_SOURCE_FACTORY);
	final CredentialsSource credentialsSource = credentialsSourceFactory != null ? credentialsSourceFactory
			.getCredentialsForType(serviceConfiguration.getCredentialsType()) : null;
	ServiceConnector serviceConnector = null;

	if (serviceConfiguration.getCredentialsType() != null && credentialsSource == null) {
		throw new RiceRuntimeException("Service requires credentials but no factory or CredentialsSource could be located.");
	}

	String alternateEndpoint = determineAlternateEndpoint(serviceConfiguration);
	URL alternateEndpointUrl = null;
	if (!StringUtils.isBlank(alternateEndpoint)) {
		try {
			alternateEndpointUrl = new URL(alternateEndpoint);
		} catch (MalformedURLException e) {
			throw new IllegalStateException("Encountered invalid alternate endpoint url: " + alternateEndpoint, e);
		}
	}
	
	// TODO switch this to use serviceConfiguration.getType() at some point in the future and allow for
	// this to be easily "pluggable" with new connector types
	//
	// if set in local mode then preempt any protocol connectors
	if (ConfigContext.getCurrentContextConfig().getDevMode()) {
		serviceConnector = new BusLocalConnector(serviceConfiguration);
	} else if (serviceConfiguration instanceof JavaServiceConfiguration) {
		serviceConnector = new HttpInvokerConnector((JavaServiceConfiguration) serviceConfiguration, alternateEndpointUrl);
	} else if (serviceConfiguration instanceof SoapServiceConfiguration) {
		serviceConnector = new SOAPConnector((SoapServiceConfiguration) serviceConfiguration, alternateEndpointUrl);
	} else if (serviceConfiguration instanceof RestServiceConfiguration) {
		serviceConnector = new RESTConnector((RestServiceConfiguration) serviceConfiguration, alternateEndpointUrl);
	}

	if (serviceConnector == null) {
		throw new RiceRuntimeException("Don't support service type of "	+ serviceConfiguration);
	}
	serviceConnector.setCredentialsSource(credentialsSource);

	return serviceConnector;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:45,代码来源:ServiceConnectorFactory.java

示例8: setCredentialsSource

import org.kuali.rice.core.api.security.credentials.CredentialsSource; //导入依赖的package包/类
/**
 * Method to set the optional CredentialsSource. A ServiceConnector is free
 * to use the CredentialsSource to provide credentials to a remote service.

 */
void setCredentialsSource(CredentialsSource credentialsSource);
 
开发者ID:kuali,项目名称:kc-rice,代码行数:7,代码来源:ServiceConnector.java


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