public SAMLAuthnRequest(AuthnRequest authnRequest) { super(authnRequest); consumerServiceURL = authnRequest.getAssertionConsumerServiceURL(); forceAuthn = authnRequest.isForceAuthn().booleanValue(); if (authnRequest.getSubject() != null && authnRequest.getSubject().getNameID() != null) { subjectNameId = authnRequest.getSubject().getNameID().getValue(); } }
private void validateRequest(RequestAbstractType parsedRequest) throws ProcessingException { if (parsedRequest.getIssuer() == null) { LOG.debug("No Issuer is present in the AuthnRequest/LogoutRequest"); throw new ProcessingException(TYPE.BAD_REQUEST); } String format = parsedRequest.getIssuer().getFormat(); if (format != null && !"urn:oasis:names:tc:SAML:2.0:nameid-format:entity".equals(format)) { LOG.debug("An invalid Format attribute was received: {}", format); throw new ProcessingException(TYPE.BAD_REQUEST); } if (parsedRequest instanceof AuthnRequest) { // No SubjectConfirmation Elements are allowed AuthnRequest authnRequest = (AuthnRequest)parsedRequest; if (authnRequest.getSubject() != null && authnRequest.getSubject().getSubjectConfirmations() != null && !authnRequest.getSubject().getSubjectConfirmations().isEmpty()) { LOG.debug("An invalid SubjectConfirmation Element was received"); throw new ProcessingException(TYPE.BAD_REQUEST); } } }
final org.opensaml.saml.saml2.core.AuthnRequest request = (org.opensaml.saml.saml2.core.AuthnRequest) samlMessage; if (request.getSubject() != null) { return request.getSubject().getNameID(); } else { return null;
if (((AuthnRequest) msg).getSubject() != null && ((AuthnRequest) msg).getSubject().getNameID() != null) { return ((AuthnRequest) msg).getSubject().getNameID().getValue();
if (((AuthnRequest) msg).getSubject() != null && ((AuthnRequest) msg).getSubject().getNameID() != null) { return ((AuthnRequest) msg).getSubject().getNameID().getFormat();
processSubject(((AuthnRequest) message).getSubject()); } else if (message instanceof SubjectQuery) { processSubject(((SubjectQuery) message).getSubject());
processSubject(profileRequestContext, ((AuthnRequest) message).getSubject()); } else if (message instanceof SubjectQuery) { processSubject(profileRequestContext, ((SubjectQuery) message).getSubject());