Hi CAS community, I am experiencing an error when I try to configure an OAuth client with the supportedGrantTypes field in the JSON service definition file.
But the tl/dr; is that I get this error:
2018-07-26 22:12:25,879 DEBUG [org.apereo.cas.services.DefaultServiceRegistryExecutionPlan] - <Registering service registry [OAuth20Ser
viceRegistry] into the execution plan>
2018-07-26 22:12:25,836 DEBUG [org.apereo.cas.services.AbstractServicesManager] - <Registering service registry [OAuth20ServiceRegistry
] into the execution planorg.apereo.cas.services.ChainingServiceRegistry@7a9f1582]>
2018-07-26 22:12:26,124 ERROR [org.apereo.cas.util.serialization.AbstractJacksonBackedStringSerializer] - <Cannot read/parse [{"@class"
:"org.apereo.cas.support.oauth.services.OAuthRegisteredService","clientId":"test_client","clientSecret":"clientSe...] to deserialize in
to type [interface org.apereo.cas.services.RegisteredService]. This may be caused in the absence of a configuration/support module that
knows how to interpret the fragment, specially if the fragment describes a CAS registered service definition. Internal parsing error i
s [Could not resolve type id 'client_credentials' as a subtype of [collection type; class java.util.HashSet, contains [simple type, cla
ss java.lang.String]]: no such class found
at [Source: (String)"{"@class":"org.apereo.cas.support.oauth.services.OAuthRegisteredService","clientId":"test_client","clientSecret":
"clientSecret","bypassApprovalPrompt":true,"generateRefreshToken":false,"serviceId":"test_client","name":"TestOAuthClient","id":"100","
supportedGrantTypes":["client_credentials"]}"; line: 1, column: 291] (through reference chain: org.apereo.cas.support.oauth.services.OA
uthRegisteredService["supportedGrantTypes"])]>
2018-07-26 22:12:26,124 DEBUG [org.apereo.cas.util.serialization.AbstractJacksonBackedStringSerializer] - <Could not resolve type id 'c
lient_credentials' as a subtype of [collection type; class java.util.HashSet, contains [simple type, class java.lang.String]]: no such
class found
at [Source: (String)"{"@class":"org.apereo.cas.support.oauth.services.OAuthRegisteredService","clientId":"test_client","clientSecret":
"clientSecret","bypassApprovalPrompt":true,"generateRefreshToken":false,"serviceId":"test_client","name":"TestOAuthClient","id":"100","
supportedGrantTypes":["client_credentials"]}"; line: 1, column: 291] (through reference chain: org.apereo.cas.support.oauth.services.OA
uthRegisteredService["supportedGrantTypes"])>
com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Could not resolve type id 'client_credentials' as a subtype of [collection t
ype; class java.util.HashSet, contains [simple type, class java.lang.String]]: no such class found
at [Source: (String)"{"@class":"org.apereo.cas.support.oauth.services.OAuthRegisteredService","clientId":"test_client","clientSecret":
"clientSecret","bypassApprovalPrompt":true,"generateRefreshToken":false,"serviceId":"test_client","name":"TestOAuthClient","id":"100","
supportedGrantTypes":["client_credentials"]}"; line: 1, column: 291] (through reference chain: org.apereo.cas.support.oauth.services.OA
uthRegisteredService["supportedGrantTypes"])
I can leave that field out completely and the service is registered, and I'm able to request a token using the client_credentials grant type, so it's not imperative that I fix this, but I would like to understand what's causing this behavior. This is using CAS 5.3.1 FWIW.
Any advice is greatly appreciated.
Thanks,
Phil