本文整理汇总了Java中org.opensaml.saml2.core.Issuer类的典型用法代码示例。如果您正苦于以下问题:Java Issuer类的具体用法?Java Issuer怎么用?Java Issuer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Issuer类属于org.opensaml.saml2.core包,在下文中一共展示了Issuer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:30,代码来源:SAML2SSOManager.java
示例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);
}
开发者ID:mxbossard,项目名称:java-saml2-sp,代码行数:22,代码来源:OpenSaml20IntegrationTest.java
示例3: processChildElement
import org.opensaml.saml2.core.Issuer; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentObject, XMLObject childObject) throws UnmarshallingException {
Assertion assertion = (Assertion) parentObject;
if (childObject instanceof Issuer) {
assertion.setIssuer((Issuer) childObject);
} else if (childObject instanceof Signature) {
assertion.setSignature((Signature) childObject);
} else if (childObject instanceof Subject) {
assertion.setSubject((Subject) childObject);
} else if (childObject instanceof Conditions) {
assertion.setConditions((Conditions) childObject);
} else if (childObject instanceof Advice) {
assertion.setAdvice((Advice) childObject);
} else if (childObject instanceof Statement) {
assertion.getStatements().add((Statement) childObject);
} else {
super.processChildElement(parentObject, childObject);
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:AssertionUnmarshaller.java
示例4: processChildElement
import org.opensaml.saml2.core.Issuer; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
throws UnmarshallingException {
ArtifactResponse artifactResponse = (ArtifactResponse) parentSAMLObject;
if (childSAMLObject instanceof Issuer) {
artifactResponse.setIssuer((Issuer) childSAMLObject);
} else if (childSAMLObject instanceof Signature) {
artifactResponse.setSignature((Signature) childSAMLObject);
} else if (childSAMLObject instanceof Extensions) {
artifactResponse.setExtensions((Extensions) childSAMLObject);
} else if (childSAMLObject instanceof Status) {
artifactResponse.setStatus((Status) childSAMLObject);
} else {
artifactResponse.setMessage((SAMLObject) childSAMLObject);
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:ArtifactResponseUnmarshaller.java
示例5: processChildElement
import org.opensaml.saml2.core.Issuer; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
throws UnmarshallingException {
StatusResponseType sr = (StatusResponseType) parentSAMLObject;
if (childSAMLObject instanceof Issuer) {
sr.setIssuer((Issuer) childSAMLObject);
} else if (childSAMLObject instanceof Signature) {
sr.setSignature((Signature) childSAMLObject);
} else if (childSAMLObject instanceof Extensions) {
sr.setExtensions((Extensions) childSAMLObject);
} else if (childSAMLObject instanceof Status) {
sr.setStatus((Status) childSAMLObject);
} else {
super.processChildElement(parentSAMLObject, childSAMLObject);
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:StatusResponseTypeUnmarshaller.java
示例6: 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;
}
开发者ID:wso2-extensions,项目名称:identity-agent-sso,代码行数:22,代码来源:SAML2SSOManager.java
示例7: getOriginatingIdpEntityId
import org.opensaml.saml2.core.Issuer; //导入依赖的package包/类
/**
* Get the id of the issuing entity.
* @param handler Handler which holds sent request ids. This is used if the response has a InResponseTo.
*
* @throws ValidationException If the response is unsolicited and does not contain an issuer.
*/
public String getOriginatingIdpEntityId(SessionHandler handler) {
if (response.getInResponseTo() == null) {
Issuer issuer = null;
if (!response.getAssertions().isEmpty()) {
issuer = response.getAssertions().get(0).getIssuer();
}
if (issuer == null) {
issuer = response.getIssuer();
}
if (issuer == null) {
throw new ValidationException("SAML Response does not contain a issuer, this is required for unsolicited Responses");
}
return issuer.getValue();
} else {
return handler.removeEntityIdForRequest(response.getInResponseTo());
}
}
开发者ID:amagdenko,项目名称:oiosaml.java,代码行数:25,代码来源:OIOResponse.java
示例8: setAssertion
import org.opensaml.saml2.core.Issuer; //导入依赖的package包/类
public synchronized void setAssertion(String sessionId, OIOAssertion assertion) throws IllegalArgumentException{
Issuer issuer = assertion.getAssertion().getIssuer();
String key = (issuer != null ? issuer.getValue() : "unknown") + ":" + assertion.getAssertion().getID();
if(usedAssertionIds.containsKey(key)) {
throw new IllegalArgumentException("Assertion ID begin replayed: " + key);
}
usedAssertionIds.put(key, assertion.getAssertion().getID());
sessionMap.put(sessionId, new TimeOutWrapper<OIOAssertion>(assertion));
String sessionIndex = assertion.getSessionIndex();
if (sessionIndex != null) {
// Remove the old sessionIndex
sessionIndexMap.remove(sessionIndex);
// Store the new sessionIndex
sessionIndexMap.put(sessionIndex, new TimeOutWrapper<String>(sessionId));
}
}
开发者ID:amagdenko,项目名称:oiosaml.java,代码行数:19,代码来源:SingleVMSessionHandler.java
示例9: 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;
}
开发者ID:imCodePartnerAB,项目名称:iVIS,代码行数:26,代码来源:SAMLRequestSender.java
示例10: 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;
}
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:40,代码来源:LogoutRequestBuilder.java
示例11: setUp
import org.opensaml.saml2.core.Issuer; //导入依赖的package包/类
/** {@inheritDoc} */
protected void setUp() throws Exception {
super.setUp();
expectedID = "def456";
expectedInResponseTo = "abc123";
expectedSAMLVersion = SAMLVersion.VERSION_20;
expectedIssueInstant = new DateTime(2006, 2, 21, 16, 40, 0, 0, ISOChronology.getInstanceUTC());
expectedDestination = "http://sp.example.org/endpoint";
expectedConsent = "urn:string:consent";
QName issuerQName = new QName(SAMLConstants.SAML20_NS, Issuer.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20_PREFIX);
expectedIssuer = (Issuer) buildXMLObject(issuerQName);
QName statusQName = new QName(SAMLConstants.SAML20P_NS, Status.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20P_PREFIX);
expectedStatus = (Status) buildXMLObject(statusQName);
}
开发者ID:apigee,项目名称:java-opensaml2,代码行数:17,代码来源:StatusResponseTestBase.java
示例12: getSAMLBuilder
import org.opensaml.saml2.core.Issuer; //导入依赖的package包/类
private static XMLObjectBuilderFactory getSAMLBuilder() throws ConfigurationException {
if (builderFactory == null) {
// OpenSAML 2.3
DefaultBootstrap.bootstrap();
builderFactory = Configuration.getBuilderFactory();
nameIdBuilder = (SAMLObjectBuilder) getSAMLBuilder().getBuilder(NameID.DEFAULT_ELEMENT_NAME);
confirmationMethodBuilder = (SAMLObjectBuilder) getSAMLBuilder().getBuilder(SubjectConfirmationData.DEFAULT_ELEMENT_NAME);
subjectConfirmationBuilder = (SAMLObjectBuilder) getSAMLBuilder().getBuilder(SubjectConfirmation.DEFAULT_ELEMENT_NAME);
subjectBuilder = (SAMLObjectBuilder) getSAMLBuilder().getBuilder(Subject.DEFAULT_ELEMENT_NAME);
attrStatementBuilder = (SAMLObjectBuilder) getSAMLBuilder().getBuilder(AttributeStatement.DEFAULT_ELEMENT_NAME);
audienceRestrictionnBuilder = (SAMLObjectBuilder) getSAMLBuilder().getBuilder(AudienceRestriction.DEFAULT_ELEMENT_NAME);
audienceBuilder = (SAMLObjectBuilder) getSAMLBuilder().getBuilder(Audience.DEFAULT_ELEMENT_NAME);
authStatementBuilder = (SAMLObjectBuilder) getSAMLBuilder().getBuilder(AuthnStatement.DEFAULT_ELEMENT_NAME);
authContextBuilder = (SAMLObjectBuilder) getSAMLBuilder().getBuilder(AuthnContext.DEFAULT_ELEMENT_NAME);
authContextClassRefBuilder = (SAMLObjectBuilder) getSAMLBuilder().getBuilder(AuthnContextClassRef.DEFAULT_ELEMENT_NAME);
issuerBuilder = (SAMLObjectBuilder) getSAMLBuilder().getBuilder(Issuer.DEFAULT_ELEMENT_NAME);
assertionBuilder = (SAMLObjectBuilder) getSAMLBuilder().getBuilder(Assertion.DEFAULT_ELEMENT_NAME);
}
return builderFactory;
}
开发者ID:mwdb,项目名称:OA2C,代码行数:24,代码来源:LocalSamlTokenFactory.java
示例13: createAssertion
import org.opensaml.saml2.core.Issuer; //导入依赖的package包/类
private Assertion createAssertion(final DateTime issueDate, Subject subject, Issuer issuer, AuthnStatement authnStatement,
AttributeStatement attributeStatement) {
AssertionBuilder assertionBuilder = new AssertionBuilder();
Assertion assertion = assertionBuilder.buildObject();
assertion.setID(UUID.randomUUID().toString());
assertion.setIssueInstant(issueDate);
assertion.setSubject(subject);
assertion.setIssuer(issuer);
if (authnStatement != null)
assertion.getAuthnStatements().add(authnStatement);
if (attributeStatement != null)
assertion.getAttributeStatements().add(attributeStatement);
return assertion;
}
开发者ID:rackerlabs,项目名称:saml-generator,代码行数:18,代码来源:SamlAssertionProducer.java
示例14: 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);
}
开发者ID:mxbossard,项目名称:java-saml2-sp,代码行数:29,代码来源:OpenSaml20IntegrationTest.java
示例15: processChildElement
import org.opensaml.saml2.core.Issuer; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
throws UnmarshallingException {
Request request = (Request) parentSAMLObject;
if (childSAMLObject instanceof Issuer) {
request.setIssuer((Issuer) childSAMLObject);
} else if (childSAMLObject instanceof IDPList) {
request.setIDPList((IDPList) childSAMLObject);
} else {
super.processChildElement(parentSAMLObject, childSAMLObject);
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:RequestUnmarshaller.java
示例16: extractEntityId
import org.opensaml.saml2.core.Issuer; //导入依赖的package包/类
/**
* Extracts the entity ID from the SAML 2 Issuer.
*
* @param issuer issuer to extract the entityID from
*
* @return entity ID of the issuer
*
* @throws MessageDecodingException thrown if the given issuer has a format other than {@link NameIDType#ENTITY}
*/
protected String extractEntityId(Issuer issuer) throws MessageDecodingException {
if (issuer != null) {
if (issuer.getFormat() == null || issuer.getFormat().equals(NameIDType.ENTITY)) {
return issuer.getValue();
} else {
throw new MessageDecodingException("SAML 2 Issuer is not of ENTITY format type");
}
}
return null;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:BaseSAML2MessageDecoder.java
示例17: processChildElement
import org.opensaml.saml2.core.Issuer; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
throws UnmarshallingException {
RequestAbstractType req = (RequestAbstractType) parentSAMLObject;
if (childSAMLObject instanceof Issuer) {
req.setIssuer((Issuer) childSAMLObject);
} else if (childSAMLObject instanceof Signature) {
req.setSignature((Signature) childSAMLObject);
} else if (childSAMLObject instanceof Extensions) {
req.setExtensions((Extensions) childSAMLObject);
} else {
super.processChildElement(parentSAMLObject, childSAMLObject);
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:RequestAbstractTypeUnmarshaller.java
示例18: 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;
}
开发者ID:italia,项目名称:spid-spring,代码行数:14,代码来源:AuthenticationInfoExtractor.java
示例19: 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;
}
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:15,代码来源:WSXACMLMessageReceiver.java
示例20: validateIssuer
import org.opensaml.saml2.core.Issuer; //导入依赖的package包/类
/**
* Check for the validity of the issuer
*
* @param issuer :who makes the claims inside the Query
* @return whether the issuer is valid
*/
private boolean validateIssuer(Issuer issuer) {
boolean isValidated = false;
if (issuer.getValue().equals("https://identity.carbon.wso2.org")
&& issuer.getSPProvidedID().equals("SPPProvierId")) {
isValidated = true;
}
return isValidated;
}
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:17,代码来源:WSXACMLMessageReceiver.java
注:本文中的org.opensaml.saml2.core.Issuer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论