本文整理汇总了Java中org.opensaml.saml2.core.Issuer.setValue方法的典型用法代码示例。如果您正苦于以下问题:Java Issuer.setValue方法的具体用法?Java Issuer.setValue怎么用?Java Issuer.setValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opensaml.saml2.core.Issuer
的用法示例。
在下文中一共展示了Issuer.setValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildLogoutRequest
import org.opensaml.saml2.core.Issuer; //导入方法依赖的package包/类
protected LogoutRequest buildLogoutRequest(String user, String sessionIdx) throws SSOAgentException {
LogoutRequest logoutReq = new LogoutRequestBuilder().buildObject();
logoutReq.setID(SSOAgentUtils.createID());
logoutReq.setDestination(ssoAgentConfig.getSAML2().getIdPURL());
DateTime issueInstant = new DateTime();
logoutReq.setIssueInstant(issueInstant);
logoutReq.setNotOnOrAfter(new DateTime(issueInstant.getMillis() + 5 * 60 * 1000));
IssuerBuilder issuerBuilder = new IssuerBuilder();
Issuer issuer = issuerBuilder.buildObject();
issuer.setValue(ssoAgentConfig.getSAML2().getSPEntityId());
logoutReq.setIssuer(issuer);
NameID nameId = new NameIDBuilder().buildObject();
nameId.setFormat("urn:oasis:names:tc:SAML:2.0:nameid-format:entity");
nameId.setValue(user);
logoutReq.setNameID(nameId);
SessionIndex sessionIndex = new SessionIndexBuilder().buildObject();
sessionIndex.setSessionIndex(sessionIdx);
logoutReq.getSessionIndexes().add(sessionIndex);
logoutReq.setReason("Single Logout");
return logoutReq;
}
示例2: testFindSaml20IdpConnectorToUseToProcessRequests
import org.opensaml.saml2.core.Issuer; //导入方法依赖的package包/类
/**
* The SP receive à LogoutRequest from the IdP. Which IdPConnector to choose ?
*
* @throws Exception
*/
@Test
public void testFindSaml20IdpConnectorToUseToProcessRequests() throws Exception {
final LogoutRequest logoutRequest = this.logoutRequestBuilder.buildObject();
final Issuer issuer = issuerBuilder.buildObject();
// Issuer
issuer.setValue(IDP2_ENTITY_ID);
// Request
logoutRequest.setIssuer(issuer);
logoutRequest.setID(REQUEST_ID);
final ISaml20IdpConnector connectorToUse = this.spProcessor.findSaml20IdpConnectorToUse(logoutRequest);
Assert.assertNotNull("No IdPConnector to use found !", connectorToUse);
Assert.assertEquals("Wrong IdPConnector used !", this.idpConnector2, connectorToUse);
}
示例3: buildLogoutResponse
import org.opensaml.saml2.core.Issuer; //导入方法依赖的package包/类
public LogoutResponse buildLogoutResponse(String id, String status, String statMsg)
throws SSOAgentException {
LogoutResponse logoutResp = new LogoutResponseBuilder().buildObject();
logoutResp.setID(SSOAgentUtils.createID());
logoutResp.setInResponseTo(id);
IssuerBuilder issuerBuilder = new IssuerBuilder();
Issuer issuer = issuerBuilder.buildObject();
issuer.setValue(ssoAgentConfig.getSAML2().getSPEntityId());
logoutResp.setIssuer(issuer);
logoutResp.setStatus(buildStatus(status, statMsg));
logoutResp.setIssueInstant(new DateTime());
logoutResp.setDestination(ssoAgentConfig.getSAML2().getIdPURL());
SSOAgentUtils.setSignatureValue(logoutResp, XMLSignature.ALGO_ID_SIGNATURE_RSA,
new X509CredentialImpl(ssoAgentConfig.getSAML2().getSSOAgentX509Credential()));
return logoutResp;
}
示例4: buildRequest
import org.opensaml.saml2.core.Issuer; //导入方法依赖的package包/类
public AuthnRequest buildRequest(String spProviderId, String acsUrl, String idpUrl){
/* Building Issuer object */
IssuerBuilder issuerBuilder = new IssuerBuilder();
Issuer issuer =
issuerBuilder.buildObject("urn:oasis:names:tc:SAML:2.0:assertion",
"Issuer", "saml2p");
issuer.setValue(spProviderId);
/* Creation of AuthRequestObject */
DateTime issueInstant = new DateTime();
AuthnRequestBuilder authRequestBuilder = new AuthnRequestBuilder();
AuthnRequest authRequest =
authRequestBuilder.buildObject(SAMLConstants.SAML20P_NS,
"AuthnRequest", "saml2p");
authRequest.setForceAuthn(false);
authRequest.setIssueInstant(issueInstant);
authRequest.setProtocolBinding(SAMLConstants.SAML2_POST_BINDING_URI);
authRequest.setAssertionConsumerServiceURL(acsUrl);
authRequest.setIssuer(issuer);
authRequest.setVersion(SAMLVersion.VERSION_20);
authRequest.setDestination(idpUrl);
return authRequest;
}
示例5: buildLogoutRequest
import org.opensaml.saml2.core.Issuer; //导入方法依赖的package包/类
/**
* Build the logout request
*
* @param subject name of the user
* @param reason reason for generating logout request.
* @return LogoutRequest object
* @throws Exception
*/
public LogoutRequest buildLogoutRequest(String subject, String reason, String sessionIndexStr) throws Exception {
log.info("Building logout request");
Util.doBootstrap();
LogoutRequest logoutReq = new org.opensaml.saml2.core.impl.LogoutRequestBuilder().buildObject();
logoutReq.setID(Util.createID());
logoutReq.setDestination(Util.getIdentityProviderSSOServiceURL());
DateTime issueInstant = new DateTime();
logoutReq.setIssueInstant(issueInstant);
logoutReq.setNotOnOrAfter(new DateTime(issueInstant.getMillis() + 5 * 60 * 1000));
IssuerBuilder issuerBuilder = new IssuerBuilder();
Issuer issuer = issuerBuilder.buildObject();
issuer.setValue(Util.getServiceProviderId());
logoutReq.setIssuer(issuer);
NameID nameId = new NameIDBuilder().buildObject();
nameId.setFormat(SAML2SSOAuthenticatorConstants.SAML2_NAME_ID_POLICY_TRANSIENT);
nameId.setValue(subject);
logoutReq.setNameID(nameId);
SessionIndex sessionIndex = new SessionIndexBuilder().buildObject();
sessionIndex.setSessionIndex(sessionIndexStr);
logoutReq.getSessionIndexes().add(sessionIndex);
logoutReq.setReason(reason);
Util.setSignature(logoutReq, XMLSignature.ALGO_ID_SIGNATURE_RSA, new SignKeyDataHolder());
return logoutReq;
}
示例6: testFindSaml20IdpConnectorToUseToProcessResponses
import org.opensaml.saml2.core.Issuer; //导入方法依赖的package包/类
/**
* The SP receive à LogoutResponse from the IdP. Which IdPConnector to choose ?
* @throws Exception
*/
@Test
public void testFindSaml20IdpConnectorToUseToProcessResponses() throws Exception {
// Mock the Original Request the response is responding to.
Mockito.when(this.samlStorage.findAuthentication(SESSION_INDEX_1)).thenReturn(this.buildBasicSamlAuthentication());
// Build the original request with IdpConnector1
final IOutgoingSaml logoutRequest = this.idpConnector1.buildSaml20SingleLogoutRequest(SESSION_INDEX_1, SamlBindingEnum.SAML_20_HTTP_POST);
Mockito.when(this.samlStorage.findRequestWaitingForResponse(REQUEST_ID)).thenReturn((IRequestWaitingForResponse) logoutRequest.getSamlQuery());
final LogoutResponse logoutResponse = this.logoutResponseBuilder.buildObject();
final Issuer issuer = issuerBuilder.buildObject();
// Issuer
issuer.setValue(IDP1_ENTITY_ID);
// Request
logoutResponse.setIssuer(issuer);
logoutResponse.setID(RESPONSE_ID);
logoutResponse.setInResponseTo(REQUEST_ID);
final ISaml20IdpConnector connectorToUse = this.spProcessor.findSaml20IdpConnectorToUse(logoutResponse);
Assert.assertNotNull("No IdPConnector to use found !", connectorToUse);
Assert.assertEquals("Wrong IdPConnector used !", this.idpConnector1, connectorToUse);
}
示例7: buildIssuer
import org.opensaml.saml2.core.Issuer; //导入方法依赖的package包/类
/**
* Costruisce lo issuer object
*
* @return Issuer object
*/
private Issuer buildIssuer(String issuerId) {
IssuerBuilder issuerBuilder = new IssuerBuilder();
Issuer issuer = issuerBuilder.buildObject();
issuer.setNameQualifier(issuerId);
issuer.setFormat(SAML2_NAME_ID_POLICY);
issuer.setValue(issuerId);
return issuer;
}
示例8: createIssuer
import org.opensaml.saml2.core.Issuer; //导入方法依赖的package包/类
/**
* Create the issuer object to be added
*
* @return : the issuer of the statements
*/
private static Issuer createIssuer() {
IssuerBuilder issuer = (IssuerBuilder) org.opensaml.xml.Configuration.getBuilderFactory().
getBuilder(Issuer.DEFAULT_ELEMENT_NAME);
Issuer issuerObject = issuer.buildObject();
issuerObject.setValue("https://identity.carbon.wso2.org");
issuerObject.setSPProvidedID("SPPProvierId");
return issuerObject;
}
示例9: getIssuer
import org.opensaml.saml2.core.Issuer; //导入方法依赖的package包/类
private Issuer getIssuer() {
@SuppressWarnings("unchecked")
Issuer issuer = ((SAMLObjectBuilder<Issuer>) _bf.
getBuilder(Issuer.DEFAULT_ELEMENT_NAME)).buildObject();
issuer.setValue(_sname);
return issuer;
}
示例10: createIssuer
import org.opensaml.saml2.core.Issuer; //导入方法依赖的package包/类
/**
* Create an issuer with a given value.
*
* @param value
* The value
* @return The SAML Issuer with the given value
*/
public static Issuer createIssuer(String value) {
if (value == null) return null;
Issuer issuer = buildXMLObject(Issuer.class);
issuer.setValue(value);
return issuer;
}
示例11: buildIssuer
import org.opensaml.saml2.core.Issuer; //导入方法依赖的package包/类
/**
* Build a SAML Issuer object
*
* @param pIssuer URL of the SAML Response Issuer
* @return SAML Issuer Object
*/
private Issuer buildIssuer(String pIssuer) {
Issuer issuer = new IssuerBuilder().buildObject();
issuer.setValue(pIssuer);
issuer.setFormat(NameIDType.ENTITY);
return issuer;
}
示例12: buildIssuer
import org.opensaml.saml2.core.Issuer; //导入方法依赖的package包/类
/**
* Build the issuer object
*
* @return Issuer object
*/
private static Issuer buildIssuer() {
IssuerBuilder issuerBuilder = new IssuerBuilder();
Issuer issuer = issuerBuilder.buildObject();
issuer.setValue(Util.getServiceProviderId());
return issuer;
}
示例13: createIssuer
import org.opensaml.saml2.core.Issuer; //导入方法依赖的package包/类
/**
* Create the issuer object to be added
*
* @return : the issuer of the statements
*/
private static Issuer createIssuer() {
IssuerBuilder issuer = (IssuerBuilder) org.opensaml.xml.Configuration.getBuilderFactory().
getBuilder(Issuer.DEFAULT_ELEMENT_NAME);
Issuer issuerObject = issuer.buildObject();
issuerObject.setValue(ISSUER_URL);
issuerObject.setSPProvidedID("SPPProvierId");
return issuerObject;
}
示例14: buildIssuer
import org.opensaml.saml2.core.Issuer; //导入方法依赖的package包/类
/**
* Build an Issuer with entity format.
*
* @return a new Issuer
*/
private Issuer buildIssuer() {
Issuer issuerXO = (Issuer) buildXMLObject(Issuer.DEFAULT_ELEMENT_NAME);
issuerXO.setValue(issuer);
issuerXO.setFormat(NameIDType.ENTITY);
return issuerXO;
}
开发者ID:apigee,项目名称:java-opensaml2,代码行数:12,代码来源:SAMLProtocolMessageXMLSignatureSecurityPolicyRuleTest.java
示例15: testNameFailure
import org.opensaml.saml2.core.Issuer; //导入方法依赖的package包/类
/**
* Tests Name failure.
*
* @throws ValidationException
*/
public void testNameFailure() throws ValidationException {
Issuer issuer = (Issuer) target;
issuer.setValue(null);
assertValidationFail("Name was null, should raise a Validation Exception");
issuer.setValue("");
assertValidationFail("Name was empty string, should raise a Validation Exception");
issuer.setValue(" ");
assertValidationFail("Name was white space, should raise a Validation Exception");
}