1 package edu.internet2.middleware.shibboleth.hs
5 import edu.internet2.middleware.shibboleth.*;
6 import edu.internet2.middleware.shibboleth.common.*;
10 public class HandleServiceSAML {
12 protected String domain;
13 protected String AAurl;
14 public String[] policies = { Constants.POLICY_CLUBSHIB };
15 private ShibPOSTProfile spp;
17 public HandleServiceSAML( String domain, String AAurl, String issuer)
23 spp = ShibPOSTProfileFactory.getInstance( policies, issuer );
26 public byte[] prepare ( String handle, String shireURL,
27 String clientAddress, String authMethod, Date authInstant )
28 throws HandleException {
31 SAMLAuthorityBinding[] bindings = new SAMLAuthorityBinding[1];
32 bindings[0] = new SAMLAuthorityBinding
33 ( SAMLBinding.SAML_SOAP_HTTPS, AAurl,
34 new QName(org.opensaml.XML.SAMLP_NS,"AttributeQuery") );
35 SAMLResponse r = spp.prepare
36 ( shireURL, handle, domain, clientAddress, authMethod,
37 authInstant, bindings, null, null, null, null
39 byte[] buf = r.toBase64();
43 catch (SAMLException ex) {
44 throw new HandleException( "Error creating SAML assertion: "+ex );
46 catch (IOException ex) {
47 throw new HandleException( "Error converting SAML assertion: "+ex);