Ejemplo n.º 1
0
  private OMElement getRSTTemplate() throws TrustException {
    OMFactory omFac = OMAbstractFactory.getOMFactory();
    OMElement element = omFac.createOMElement(SP11Constants.REQUEST_SECURITY_TOKEN_TEMPLATE);

    if (ClientConstants.SAML_TOKEN_TYPE_20.equals(tokenType)) {
      TrustUtil.createTokenTypeElement(RahasConstants.VERSION_05_02, element)
          .setText(RahasConstants.TOK_TYPE_SAML_20);
    } else if (ClientConstants.SAML_TOKEN_TYPE_11.equals(tokenType)) {
      TrustUtil.createTokenTypeElement(RahasConstants.VERSION_05_02, element)
          .setText(RahasConstants.TOK_TYPE_SAML_10);
    }

    if (ClientConstants.SUBJECT_CONFIRMATION_BEARER.equals(subjectConfirmationMethod)) {
      TrustUtil.createKeyTypeElement(
          RahasConstants.VERSION_05_02, element, RahasConstants.KEY_TYPE_BEARER);
    } else if (ClientConstants.SUBJECT_CONFIRMATION_HOLDER_OF_KEY.equals(
        subjectConfirmationMethod)) {
      TrustUtil.createKeyTypeElement(
          RahasConstants.VERSION_05_02, element, RahasConstants.KEY_TYPE_SYMM_KEY);
    }

    // request claims in the token.
    OMElement claimElement =
        TrustUtil.createClaims(RahasConstants.VERSION_05_02, element, claimDialect);
    // Populate the <Claims/> element with the <ClaimType/> elements
    addClaimType(claimElement, claimUris);

    return element;
  }
Ejemplo n.º 2
0
 private static OMElement getRSTTemplate() throws Exception {
   OMFactory fac = OMAbstractFactory.getOMFactory();
   OMElement elem = fac.createOMElement(SP11Constants.REQUEST_SECURITY_TOKEN_TEMPLATE);
   TrustUtil.createTokenTypeElement(RahasConstants.VERSION_05_02, elem)
       .setText(RahasConstants.TOK_TYPE_SAML_10);
   TrustUtil.createKeyTypeElement(
       RahasConstants.VERSION_05_02, elem, RahasConstants.KEY_TYPE_SYMM_KEY);
   TrustUtil.createKeySizeElement(RahasConstants.VERSION_05_02, elem, 256);
   return elem;
 }