> Le 13 juil. 2018 à 17:18, Chia-Ying (David) Yang <
yangch...@gmail.com> a écrit :
>
> Please include more details, like cas.properties / pom.xml / service configuration files in your email so people can help you diagnose. -- David
>
>
>
> On 07/13/2018 11:15 AM, BACCHELLA Fabrice wrote:
>> When someone got a :
>>
>> java.lang.NullPointerException: null
>> at org.apereo.cas.support.saml.authentication.principal.SamlServiceFactory.createService(SamlServiceFactory.java:65) ~[cas-server-support-saml-5.3.0.jar!/:5.3.0]
>>
>> Is there any way to solve that in a more scientific way than random try ?
>>
A NPE should never be throw with a configuration problem, it's always a bug.
But anyway, if there is no other solution, here is the informations:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="
http://maven.apache.org/POM/4.0.0" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd ">
<modelVersion>4.0.0</modelVersion>
<groupId>XXX</groupId>
<artifactId>XXXX</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<properties>
<cas.version>5.3.0</cas.version>
<springboot.version>1.5.14.RELEASE</springboot.version>
<app.server>-tomcat</app.server>
<mainClassName>org.springframework.boot.loader.WarLauncher</mainClassName>
<isExecutable>true</isExecutable>
<manifestFileToUse>${project.build.directory}/war/work/org.apereo.cas/cas-server-webapp${app.server}/META-INF/MANIFEST.MF</manifestFileToUse>
</properties>
<dependencies>
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-webapp${app.server}</artifactId>
<version>${cas.version}</version>
<type>war</type>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-support-basic</artifactId>
</dependency>
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-support-ldap</artifactId>
</dependency>
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-support-spnego-webflow</artifactId>
</dependency>
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-support-yaml-service-registry</artifactId>
</dependency>
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-support-saml</artifactId>
</dependency>
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-support-rest</artifactId>
</dependency>
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-webapp-config-security</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.rimerosolutions.maven.plugins</groupId>
<artifactId>wrapper-maven-plugin</artifactId>
<version>0.0.4</version>
<configuration>
<verifyDownload>true</verifyDownload>
<checksumAlgorithm>MD5</checksumAlgorithm>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${springboot.version}</version>
<configuration>
<mainClass>${mainClassName}</mainClass>
<addResources>true</addResources>
<executable>${isExecutable}</executable>
<layout>WAR</layout>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<warName>cas</warName>
<failOnMissingWebXml>false</failOnMissingWebXml>
<recompressZippedFiles>false</recompressZippedFiles>
<archive>
<compress>false</compress>
<manifestFile>${manifestFileToUse}</manifestFile>
</archive>
<overlays>
<overlay>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-webapp${app.server}</artifactId>
</overlay>
</overlays>
</configuration>
</plugin>
</plugins>
<finalName>cas</finalName>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-support-bom</artifactId>
<version>${cas.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<repositories>
<repository>
<id>sonatype-releases</id>
<url>
http://oss.sonatype.org/content/repositories/releases/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
<repository>
<id>sonatype-snapshots</id>
<url>
https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
<repository>
<id>shibboleth-releases</id>
<url>
https://build.shibboleth.net/nexus/content/repositories/releases</url>
</repository>
<repository>
<id>jasig-releases</id>
<url>
http://developer.jasig.org/repo/content/groups/m2-legacy</url>
</repository>
</repositories>
<profiles>
<profile>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<id>default</id>
<dependencies>
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-webapp${app.server}</artifactId>
<version>${cas.version}</version>
<type>war</type>
<scope>runtime</scope>
</dependency>
</dependencies>
</profile>
<profile>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<id>bootiful</id>
<properties>
<app.server>-tomcat</app.server>
<isExecutable>false</isExecutable>
</properties>
<dependencies>
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-webapp${app.server}</artifactId>
<version>${cas.version}</version>
<type>war</type>
<scope>runtime</scope>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
And the cas.properties:
cas.server.name:
http://XXX
cas.server.prefix:
http://XXX/
cas.authn.accept.users=
server.contextPath=/
server.tomcat.basedir=/data/cas/run
server.ssl.enabled=false
server.ssl.protocol=TLSv1.2
server.ssl.keyStore=file:/data/cas/conf/cas.p12
server.ssl.keyStorePassword=XXX
server.ssl.keyPassword=XXXX
server.ssl.keyStoreType=PKCS12
server.ssl.keyAlias=XXXX
logging.config=file:/data/cas/conf/log4j2.xml
cas.standalone.configurationDirectory=/data/cas/conf
cas.webflow.crypto.encryption.key=XXX
cas.webflow.crypto.signing.key=XXX
cas.tgc.crypto.encryption.key=XXX
cas.tgc.crypto.signing.key=XXXX
cas.ticket.registry.inMemory.cache=true
cas.authn.ldap[0].name=XXX
cas.authn.ldap[0].order=0
cas.authn.ldap[0].maxPoolSize=1
cas.authn.ldap[0].minPoolSize=1
cas.authn.ldap[0].type=AD
cas.authn.ldap[0].ldapUrl=ldaps://XXX
cas.authn.ldap[0].bindDn=XXXX
cas.authn.ldap[0].bindCredential=XXX
cas.authn.ldap[0].baseDn=XXX
cas.authn.ldap[0].searchFilter=sAMAccountName={user}
cas.authn.ldap[0].dnFormat=%s@XXX
cas.authn.ldap[0].trustCertificates=file:/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
cas.authn.ldap[0].useSsl=true
cas.authn.ldap[0].useStartTls=false
cas.authn.ldap[0].principalAttributeList=mail,sn,givenName,displayName,memberOf
cas.authn.ldap[1].name=XXX
cas.authn.ldap[1].order=1
cas.authn.ldap[1].maxPoolSize=1
cas.authn.ldap[1].minPoolSize=1
cas.authn.ldap[1].type=AUTHENTICATED
cas.authn.ldap[1].ldapUrl=ldaps://XXX
cas.authn.ldap[1].bindDn=XXX
cas.authn.ldap[1].bindCredential=XXX
cas.authn.ldap[1].baseDn=XXX
cas.authn.ldap[1].searchFilter=uid={user}
cas.authn.ldap[1].dnFormat=%s@XXXX
cas.authn.ldap[1].trustCertificates=file:/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
cas.authn.ldap[1].useSsl=true
cas.authn.ldap[1].useStartTls=false
cas.authn.ldap[1].principalAttributeList=mail,sn,givenName,displayName,memberOf
cas.authn.ldap[1].principalAttributeId=employeeID
cas.authn.spnego.name=KerberosOffice
cas.authn.spnego.mixedModeAuthentication=true
cas.authn.spnego.jcifsServicePrincipal=HTTP/XXXX
cas.authn.spnego.loginConf=file:/data/cas/conf/login.conf
cas.authn.spnego.kerberosConf=file:/data/cas/conf/krb5.conf
cas.authn.spnego.supportedBrowsers=MSIE,Trident,Firefox,AppleWebKit,curl
cas.serviceRegistry.yaml.location=file:/data/cas/conf/services
cas.monitor.endpoints.status.enabled=true
cas.monitor.endpoints.status.sensitive=false
cas.adminPagesSecurity.ip=.*
security.basic.authorizeMode=none
# If you wish to protect the admin pages via CAS itself, configure the rest.
cas.adminPagesSecurity.loginUrl=
http://XXXX:8443/login
cas.adminPagesSecurity.service=http:/XXXXX:8443/status/dashboard
cas.adminPagesSecurity.users=file:/data/cas/conf/adminusers.properties
cas.adminPagesSecurity.adminRoles[0]=ROLE_ADMIN
# Attributes
cas.authn.attributeRepository.expireInMinutes=30
cas.authn.attributeRepository.maximumCacheSize=10000
cas.authn.attributeRepository.merger=MERGE
cas.authn.attributeRepository.ldap[0].name=DSONE
cas.authn.attributeRepository.ldap[0].order=0
cas.authn.attributeRepository.ldap[0].maxPoolSize=1
cas.authn.attributeRepository.ldap[0].minPoolSize=1
cas.authn.attributeRepository.ldap[0].type=AD
cas.authn.attributeRepository.ldap[0].ldapUrl=ldaps://XXXX
cas.authn.attributeRepository.ldap[0].bindDn=XXXX
cas.authn.attributeRepository.ldap[0].bindCredential=XXXX
cas.authn.attributeRepository.ldap[0].baseDn=XXX
cas.authn.attributeRepository.ldap[0].searchFilter=sAMAccountName={user}
cas.authn.attributeRepository.ldap[0].dnFormat=%s@XXXX
cas.authn.attributeRepository.ldap[0].trustCertificates=file:/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
cas.authn.attributeRepository.ldap[0].useSsl=true
cas.authn.attributeRepository.ldap[0].useStartTls=false
cas.authn.attributeRepository.ldap[0].principalAttributeList=mail,sn,givenName,displayName,memberOf
cas.authn.attributeRepository.ldap[0].
attributes.cn=name
cas.authn.attributeRepository.ldap[0].attributes.givenName=firstName
cas.authn.attributeRepository.ldap[0].
attributes.sn=lastName
cas.authn.attributeRepository.ldap[0].attributes.ou=ou
cas.authn.attributeRepository.ldap[0].attributes.uid=uid
cas.authn.attributeRepository.ldap[0].attributes.mail=mail
cas.authn.attributeRepository.ldap[0].attributes.displayName=displayName
cas.authn.attributeRepository.ldap[0].attributes.memberOf=memberOf