Hello,
i'm trying to set up my application to log in CAS 5.2.0 using OAuth2 protocol. When I try to get the access token, CAS server returns 500 code to my application and have this stack in log:
2017-12-21 13:53:27,263 ERROR [org.springframework.boot.web.support.ErrorPageFilter] - <Forwarding to error page from request [/oauth2.0/accessToken] due to exception [ticket cannot be null]>
java.lang.RuntimeException: ticket cannot be null
at org.apereo.cas.support.oauth.web.endpoints.OAuth20AccessTokenEndpointController.handleRequest(OAuth20AccessTokenEndpointController.java:120) ~[cas-server-support-oauth-5.2.0.jar:5.2.0]
at org.apereo.cas.support.oauth.web.endpoints.OAuth20AccessTokenEndpointController$$FastClassBySpringCGLIB$$db180f28.invoke(<generated>) ~[cas-server-support-oauth-5.2.0.jar:5.2.0]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-4.3.12.RELEASE.jar:4.3.12.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738) ~[spring-aop-4.3.12.RELEASE.jar:4.3.12.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) ~[spring-aop-4.3.12.RELEASE.jar:4.3.12.RELEASE]
[...]
I'm using maven War Overlay, registering services using json files, and authenticating by a txt file, just for testing.
Here is my service json config:
{
"@class": "org.apereo.cas.support.oauth.services.OAuthRegisteredService",
"serviceId": "^http://.*",
"name": "application_name",
"id": 1000,
"clientId": 123,
"clientSecret": 123,
"jsonFormat" : false,
"bypassApprovalPrompt": true,
"generateRefreshToken": false,
"attributeReleasePolicy" : {
"@class" : "org.apereo.cas.services.ReturnAllAttributeReleasePolicy"
},
}
My application.yml
server:
ssl:
enabled: true
key-store: ./keystore.jks
key-store-password: password
key-password: password
key-alias: cas
cas:
server:
authn:
accept:
users: null
file:
filename: classpath:whitelist.txt
adminPagesSecurity:
ip: 127.0.0.1
loginUrl: https://10.19.10.33:8443/cas/login
adminRoles: ROLE_ADMIN
users: classpath:/adminusers.properties
monitor:
endpoints:
enabled: true
sensitive: false
serviceRegistry:
yaml:
location: classpath:/services
tgc:
path: null
maxAge: -1
domain: localhost
name: TGC
secure: false
httpOnly: true
rememberMeMaxAge: 1209600
crypto:
encryption:
key: <hide>
signing:
key: <hide>
enabled: true
monitor:
st:
warn:
threshold: 10
evictionThreshold: 0
tgt:
warn:
threshold: 10
evictionThreshold: 0
spring:
config:
name: cfs-cas
management:
contextPath: /status
security:
enabled: true
roles: ADMIN
sessions: IF_REQUIRED
logging:
config: classpath:log4j2.xml
Is there something I'm missing?