本文整理汇总了Java中org.cagrid.gaards.authentication.client.AuthenticationClient类的典型用法代码示例。如果您正苦于以下问题:Java AuthenticationClient类的具体用法?Java AuthenticationClient怎么用?Java AuthenticationClient使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AuthenticationClient类属于org.cagrid.gaards.authentication.client包,在下文中一共展示了AuthenticationClient类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: authenticate
import org.cagrid.gaards.authentication.client.AuthenticationClient; //导入依赖的package包/类
public SAMLAssertion authenticate(String authenticationServiceURL,
Credential credential) throws AuthenticationErrorException,
AuthenticationConfigurationException {
try {
AuthenticationClient authenticationClient = new AuthenticationClient(
authenticationServiceURL);
SAMLAssertion samlAssertion = authenticationClient
.authenticate(credential);
log.debug("authentication successful url"
+ authenticationServiceURL);
return samlAssertion;
} catch (Exception e) {
handleException(e);
}
return null;
}
示例2: authenticate
import org.cagrid.gaards.authentication.client.AuthenticationClient; //导入依赖的package包/类
/*********************
* This method is used to get the globus credential for given dorian url, authentication service url, user id and string.
* @param dorianURL
* @param authenticationServiceURL
* @param userId
* @param password
* @return globus credential of the user.
* @throws Exception
*/
public static GlobusCredential authenticate(String dorianURL,
String authenticationServiceURL, String userId, String password)
throws Exception
{
// Create credential
BasicAuthentication auth = new BasicAuthentication();
auth.setUserId(userId);
auth.setPassword(password);
// Authenticate to the IdP (DorianIdP) using credential
AuthenticationClient authClient = new AuthenticationClient(
authenticationServiceURL);
SAMLAssertion saml = authClient.authenticate(auth);
// Requested Grid Credential lifetime (12 hours)
CertificateLifetime lifetime = new CertificateLifetime();
lifetime.setHours(12);
// Request PKI/Grid Credential
GridUserClient dorian = new GridUserClient(dorianURL);
GlobusCredential credential = dorian.requestUserCertificate(saml,
lifetime);
return credential;
}
示例3: runStep
import org.cagrid.gaards.authentication.client.AuthenticationClient; //导入依赖的package包/类
@Override
public void runStep() throws Throwable {
BasicAuthentication authCred = new BasicAuthentication();
authCred.setUserId(this.userId);
authCred.setPassword(this.password);
AuthenticationClient client = new AuthenticationClient(this.serviceURL);
this.saml = client.authenticate(authCred);
GridUserClient c2 = new GridUserClient(this.serviceURL);
this.credential = c2.requestUserCertificate(this.saml, new CertificateLifetime(this.hours, 0, 0));
ProxyUtil.saveProxyAsDefault(this.credential);
}
示例4: runStep
import org.cagrid.gaards.authentication.client.AuthenticationClient; //导入依赖的package包/类
@Override
public void runStep() throws Throwable {
BasicAuthentication authCred = new BasicAuthentication();
authCred.setUserId(this.userId);
authCred.setPassword(this.password);
AuthenticationClient client = new AuthenticationClient(this.serviceURL);
this.saml = client.authenticate(authCred);
GridUserClient c2 = new GridUserClient(this.serviceURL);
this.credential = c2.requestUserCertificate(this.saml, new CertificateLifetime(
this.hours, 0, 0));
ProxyUtil.saveProxyAsDefault(this.credential);
}
示例5: getAuthenticationClient
import org.cagrid.gaards.authentication.client.AuthenticationClient; //导入依赖的package包/类
public AuthenticationClient getAuthenticationClient() throws Exception {
if (getServiceDescriptor().getServiceURL() != null) {
AuthenticationClient client = new AuthenticationClient(
getServiceDescriptor().getServiceURL());
if (Utils.clean(getServiceDescriptor().getServiceIdentity()) != null) {
IdentityAuthorization auth = new IdentityAuthorization(
getServiceDescriptor().getServiceIdentity());
client.setAuthorization(auth);
}
return client;
}
return null;
}
示例6: authenticate
import org.cagrid.gaards.authentication.client.AuthenticationClient; //导入依赖的package包/类
public SAMLAssertion authenticate() throws Exception {
AuthenticationClient client = new AuthenticationClient(getServiceURL());
return client.authenticate(this.credential);
}
示例7: authenticate
import org.cagrid.gaards.authentication.client.AuthenticationClient; //导入依赖的package包/类
public SAMLAssertion authenticate() throws Exception {
AuthenticationClient client = new AuthenticationClient(getServiceURL());
return client.authenticate(this.credential);
}