Search in sources :

Example 1 with UriRealmParser

use of org.apereo.cas.support.realm.UriRealmParser in project cas by apereo.

the class CoreWsSecuritySecurityTokenServiceConfiguration method transportSTSProperties.

@RefreshScope
@ConditionalOnMissingBean(name = "transportSTSProperties")
@Bean
public STSPropertiesMBean transportSTSProperties() {
    final WsFederationProperties.SecurityTokenService wsfed = casProperties.getAuthn().getWsfedIdP().getSts();
    final WsFederationProperties.IdentityProvider idp = casProperties.getAuthn().getWsfedIdP().getIdp();
    final StaticSTSProperties s = new StaticSTSProperties();
    s.setIssuer(getClass().getSimpleName());
    s.setRealmParser(new UriRealmParser(realms()));
    s.setSignatureCryptoProperties(CryptoUtils.getSecurityProperties(wsfed.getSigningKeystoreFile(), wsfed.getSigningKeystorePassword()));
    s.setEncryptionCryptoProperties(CryptoUtils.getSecurityProperties(wsfed.getEncryptionKeystoreFile(), wsfed.getEncryptionKeystorePassword()));
    final Relationship rel = new Relationship();
    rel.setType(Relationship.FED_TYPE_IDENTITY);
    rel.setSourceRealm(idp.getRealmName());
    rel.setTargetRealm(idp.getRealmName());
    s.setRelationships(Arrays.asList(rel));
    return s;
}
Also used : WsFederationProperties(org.apereo.cas.configuration.model.support.wsfed.WsFederationProperties) Relationship(org.apache.cxf.sts.token.realm.Relationship) UriRealmParser(org.apereo.cas.support.realm.UriRealmParser) StaticSTSProperties(org.apache.cxf.sts.StaticSTSProperties) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) STSPropertiesMBean(org.apache.cxf.sts.STSPropertiesMBean) ServletRegistrationBean(org.springframework.boot.web.servlet.ServletRegistrationBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

STSPropertiesMBean (org.apache.cxf.sts.STSPropertiesMBean)1 StaticSTSProperties (org.apache.cxf.sts.StaticSTSProperties)1 Relationship (org.apache.cxf.sts.token.realm.Relationship)1 WsFederationProperties (org.apereo.cas.configuration.model.support.wsfed.WsFederationProperties)1 UriRealmParser (org.apereo.cas.support.realm.UriRealmParser)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 ServletRegistrationBean (org.springframework.boot.web.servlet.ServletRegistrationBean)1 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)1 Bean (org.springframework.context.annotation.Bean)1