Search in sources :

Example 1 with ServerManager

use of org.openid4java.server.ServerManager in project cas by apereo.

the class OpenIdConfiguration method serverManager.

@RefreshScope
@Bean
public ServerManager serverManager() {
    final ServerManager manager = new ServerManager();
    manager.setOPEndpointUrl(casProperties.getServer().getLoginUrl());
    manager.setEnforceRpId(casProperties.getAuthn().getOpenid().isEnforceRpId());
    manager.setSharedAssociations(new InMemoryServerAssociationStore());
    LOGGER.info("Creating openid server manager with OP endpoint [{}]", casProperties.getServer().getLoginUrl());
    return manager;
}
Also used : ServerManager(org.openid4java.server.ServerManager) InMemoryServerAssociationStore(org.openid4java.server.InMemoryServerAssociationStore) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 2 with ServerManager

use of org.openid4java.server.ServerManager in project cas by apereo.

the class OpenIdConfiguration method serverManager.

@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
@Bean
@ConditionalOnMissingBean(name = "serverManager")
public ServerManager serverManager(final CasConfigurationProperties casProperties) {
    val manager = new ServerManager();
    manager.setOPEndpointUrl(casProperties.getServer().getLoginUrl());
    manager.setEnforceRpId(casProperties.getAuthn().getOpenid().isEnforceRpId());
    manager.setSharedAssociations(new InMemoryServerAssociationStore());
    LOGGER.trace("Creating openid server manager with OP endpoint [{}]", casProperties.getServer().getLoginUrl());
    return manager;
}
Also used : lombok.val(lombok.val) ServerManager(org.openid4java.server.ServerManager) InMemoryServerAssociationStore(org.openid4java.server.InMemoryServerAssociationStore) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

InMemoryServerAssociationStore (org.openid4java.server.InMemoryServerAssociationStore)2 ServerManager (org.openid4java.server.ServerManager)2 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)2 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)2 Bean (org.springframework.context.annotation.Bean)2 lombok.val (lombok.val)1