private String generateId() { return IDGenerator.create("ID_"); }
/** * Create an id that is prefixed by a string * @param prefix * @return an id * @throws IllegalArgumentException when prefix is null */ public static String create(String prefix) { if (prefix == null) throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "prefix"); StringBuilder sb = new StringBuilder(prefix); sb.append(IDGenerator.create()); return sb.toString(); } }
/** * Create an id that is prefixed by a string * @param prefix * @return an id * @throws IllegalArgumentException when prefix is null */ public static String create(String prefix) { if (prefix == null) throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "prefix"); StringBuilder sb = new StringBuilder(prefix); sb.append(IDGenerator.create()); return sb.toString(); } }
/** * Create an id that is prefixed by a string * * @param prefix * @return an id * @throws IllegalArgumentException when prefix is null */ public static String create(String prefix) { if (prefix == null) throw logger.nullArgumentError("prefix"); StringBuilder sb = new StringBuilder(prefix); sb.append(IDGenerator.create()); return sb.toString(); } }
/** * Create an id that is prefixed by a string * * @param prefix * * @return an id * * @throws IllegalArgumentException when prefix is null */ public static String create(String prefix) { if (prefix == null) throw logger.nullArgumentError("prefix"); StringBuilder sb = new StringBuilder(prefix); sb.append(IDGenerator.create()); return sb.toString(); } }
/** * Create an id that is prefixed by a string * * @param prefix * * @return an id * * @throws IllegalArgumentException when prefix is null */ public static String create(String prefix) { if (prefix == null) throw logger.nullArgumentError("prefix"); StringBuilder sb = new StringBuilder(prefix); sb.append(IDGenerator.create()); return sb.toString(); } }
/** * Create a SAML2 auth request * * @param serviceURL URL of the service * @param identityURL URL of the identity provider * * @return * * @throws ConfigurationException */ private AuthnRequestType createSAMLRequest(String serviceURL, String identityURL) throws ConfigurationException { if (serviceURL == null) throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "serviceURL"); if (identityURL == null) throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "identityURL"); SAML2Request saml2Request = new SAML2Request(); String id = IDGenerator.create("ID_"); return saml2Request.createAuthnRequestType(id, serviceURL, identityURL, serviceURL); }
/** * Create a SAML2 auth request * @param serviceURL URL of the service * @param identityURL URL of the identity provider * @return * @throws ConfigurationException */ private AuthnRequestType createSAMLRequest(String serviceURL, String identityURL) throws ConfigurationException { if (serviceURL == null) throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "serviceURL"); if (identityURL == null) throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "identityURL"); SAML2Request saml2Request = new SAML2Request(); String id = IDGenerator.create("ID_"); return saml2Request.createAuthnRequestType(id, serviceURL, identityURL, serviceURL); }
/** * Create a SAML2 auth request * @param serviceURL URL of the service * @param identityURL URL of the identity provider * @return * @throws ConfigurationException */ private AuthnRequestType createSAMLRequest(String serviceURL, String identityURL) throws ConfigurationException { if (serviceURL == null) throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "serviceURL"); if (identityURL == null) throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "identityURL"); SAML2Request saml2Request = new SAML2Request(); String id = IDGenerator.create("ID_"); return saml2Request.createAuthnRequestType(id, serviceURL, identityURL, serviceURL); }
/** * Create a SAML2 auth request * * @param serviceURL URL of the service * @param identityURL URL of the identity provider * @return * @throws ConfigurationException */ private AuthnRequestType createSAMLRequest(String serviceURL, String identityURL) throws ConfigurationException { if (serviceURL == null) throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "serviceURL"); if (identityURL == null) throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "identityURL"); SAML2Request saml2Request = new SAML2Request(); String id = IDGenerator.create("ID_"); return saml2Request.createAuthnRequestType(id, serviceURL, identityURL, serviceURL); }
/** * Create a SAML2 auth request * * @param serviceURL URL of the service * @param identityURL URL of the identity provider * * @return * * @throws ConfigurationException */ private AuthnRequestType createSAMLRequest(String serviceURL, String identityURL) throws ConfigurationException { if (serviceURL == null) throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "serviceURL"); //$NON-NLS-1$ if (identityURL == null) throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "identityURL"); //$NON-NLS-1$ SAML2Request saml2Request = new SAML2Request(); String id = IDGenerator.create("ID_"); //$NON-NLS-1$ return saml2Request.createAuthnRequestType(id, serviceURL, identityURL, serviceURL); }
/** * Create a SAML2 auth request * * @param serviceURL URL of the service * @param identityURL URL of the identity provider * * @return * * @throws ConfigurationException */ private AuthnRequestType createSAMLRequest(String serviceURL, String identityURL) throws ConfigurationException { if (serviceURL == null) throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "serviceURL"); if (identityURL == null) throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "identityURL"); SAML2Request saml2Request = new SAML2Request(); String id = IDGenerator.create("ID_"); return saml2Request.createAuthnRequestType(id, serviceURL, identityURL, serviceURL); }
private void handleSAML2UnsolicitedResponse(HttpServletRequest request, HttpServletResponse response) throws ServletException { SAML2Request samlRequest = new SAML2Request(); String id = IDGenerator.create("ID_"); String assertionConsumerURL = request.getParameter(JBossSAMLConstants.UNSOLICITED_RESPONSE_TARGET.get()); try { AuthnRequestType authn = samlRequest .createAuthnRequestType(id, assertionConsumerURL, getIdentityURL(), assertionConsumerURL); String requestedBinding = request.getParameter(JBossSAMLConstants.UNSOLICITED_RESPONSE_SAML_BINDING.get()); if ("POST".equalsIgnoreCase(requestedBinding)) { authn.setProtocolBinding(URI.create(JBossSAMLURIConstants.SAML_HTTP_POST_BINDING.get())); } else { authn.setProtocolBinding(URI.create(JBossSAMLURIConstants.SAML_HTTP_REDIRECT_BINDING.get())); } authn.setUnsolicitedResponse(true); processSAMLRequestMessage(request, response, authn, true); } catch (Exception e) { throw new ServletException("Could not handle SAML 2.0 Unsolicited Response.", e); } }
private void handleSAML2UnsolicitedResponse(HttpServletRequest request, HttpServletResponse response) throws ServletException { SAML2Request samlRequest = new SAML2Request(); String id = IDGenerator.create("ID_"); String assertionConsumerURL = request.getParameter(JBossSAMLConstants.UNSOLICITED_RESPONSE_TARGET.get()); try { AuthnRequestType authn = samlRequest .createAuthnRequestType(id, assertionConsumerURL, getIdentityURL(), assertionConsumerURL); String requestedBinding = request.getParameter(JBossSAMLConstants.UNSOLICITED_RESPONSE_SAML_BINDING.get()); if ("POST".equalsIgnoreCase(requestedBinding)) { authn.setProtocolBinding(URI.create(JBossSAMLURIConstants.SAML_HTTP_POST_BINDING.get())); } else { authn.setProtocolBinding(URI.create(JBossSAMLURIConstants.SAML_HTTP_REDIRECT_BINDING.get())); } authn.setUnsolicitedResponse(true); processSAMLRequestMessage(request, response, authn, true); } catch (Exception e) { throw new ServletException("Could not handle SAML 2.0 Unsolicited Response.", e); } }
/** * Create a SAML2 auth request * * @param serviceURL URL of the service * @param identityURL URL of the identity provider * * @return * * @throws ConfigurationException */ public AuthnRequestType createSAMLRequest(String serviceURL, String identityURL) throws ConfigurationException { if (serviceURL == null) { throw logger.nullArgumentError("serviceURL"); } if (identityURL == null) { throw logger.nullArgumentError("identityURL"); } SAML2Request saml2Request = new SAML2Request(); String id = IDGenerator.create("ID_"); return saml2Request.createAuthnRequestType(id, serviceURL, identityURL, serviceURL); }
/** * Create a SAML2 auth request * * @param serviceURL URL of the service * @param identityURL URL of the identity provider * * @return * * @throws ConfigurationException */ public AuthnRequestType createSAMLRequest(String serviceURL, String identityURL) throws ConfigurationException { if (serviceURL == null) { throw logger.nullArgumentError("serviceURL"); } if (identityURL == null) { throw logger.nullArgumentError("identityURL"); } SAML2Request saml2Request = new SAML2Request(); String id = IDGenerator.create("ID_"); return saml2Request.createAuthnRequestType(id, serviceURL, identityURL, serviceURL); }
/** * Create a SAML2 auth request * * @param serviceURL URL of the service * @param identityURL URL of the identity provider * * @return * * @throws ConfigurationException */ public AuthnRequestType createSAMLRequest(String serviceURL, String identityURL) throws ConfigurationException { if (serviceURL == null) { throw logger.nullArgumentError("serviceURL"); } if (identityURL == null) { throw logger.nullArgumentError("identityURL"); } SAML2Request saml2Request = new SAML2Request(); String id = IDGenerator.create("ID_"); return saml2Request.createAuthnRequestType(id, serviceURL, identityURL, serviceURL); }
/** * Create a Logout Request * * @param issuer * @return * @throws ConfigurationException */ public LogoutRequestType createLogoutRequest(String issuer) throws ConfigurationException { LogoutRequestType lrt = new LogoutRequestType(IDGenerator.create("ID_"), XMLTimeUtil.getIssueInstant()); // Create an issuer NameIDType issuerNameID = new NameIDType(); issuerNameID.setValue(issuer); lrt.setIssuer(issuerNameID); return lrt; }
/** * Create a Logout Request * @param issuer * @return * @throws ConfigurationException */ public LogoutRequestType createLogoutRequest(String issuer) throws ConfigurationException { LogoutRequestType lrt = new LogoutRequestType(IDGenerator.create("ID_"), XMLTimeUtil.getIssueInstant()); //Create an issuer NameIDType issuerNameID = new NameIDType(); issuerNameID.setValue(issuer); lrt.setIssuer(issuerNameID); return lrt; }
/** * Create a Logout Request * * @param issuer * * @return * * @throws ConfigurationException */ public LogoutRequestType createLogoutRequest(String issuer) throws ConfigurationException { LogoutRequestType lrt = new LogoutRequestType(IDGenerator.create("ID_"), XMLTimeUtil.getIssueInstant()); // Create an issuer NameIDType issuerNameID = new NameIDType(); issuerNameID.setValue(issuer); lrt.setIssuer(issuerNameID); return lrt; }