[
https://issues.apache.org/jira/browse/CXF-6573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14728707#comment-14728707
]
Sergey Beryozkin commented on CXF-6573:
---------------------------------------
I'm not keen at all to introduce Jackson project dependencies.
OAuthJsonProvider will win over Jackson when both providers are registered at
the same time and when it is either OAuthError or ClientAccessToken that needs
to be written. It is JAX-RS spec. Simply have both providers registered.
In fact, I'm not sure why both providers are needed in a jaxrs endpoint
representing an OAuth2 Access Token Service - JSON response is only coming out
of the grant to token exchange request and OAuthJsonProvider does the job. Why
to use Jackson ?
If you do prefer Jackson: you've mentioned JAXB, so if you have
JacksonJaxbJsonProvider then I'm assuming you can have AccessToken annotated
with few JAXB annotations ? That can be acceptable as JAXB dependency is
already there. Having JAXB annotations and also possibly initializing
JacksonJaxbJsonProvider with a custom ObjectMapper (via constructor, to get a
'parameters' field dropped) may work - can you please experiment - if you can
get it working then I'll be OK with adding few JAXB annotations to AccessToken.
Thanks
> AccessToken doesn't serialize with snake-case
> ---------------------------------------------
>
> Key: CXF-6573
> URL: https://issues.apache.org/jira/browse/CXF-6573
> Project: CXF
> Issue Type: Wish
> Components: JAX-RS Security
> Affects Versions: 3.1.2
> Reporter: Karl von Randow
> Priority: Minor
>
> The org.apache.cxf.rs.security.oauth2.common.AccessToken class doesn't
> declare and JAXB (or other) annotations to influence how it is serialized. So
> it uses the default serialization style of the JAXB context.
> In my case this is camel case.
> This means that the AccessToken response from the AccessTokenService uses
> camel case. The OAuth docs _appear_ (I'm not a scholar of them) to indicate
> that it should be snake case.
> Is that true? Is this a thing? Would it be something you'd consider, adding
> `@XmlElement(name = "token_key")` annotations? That would be a breaking
> change for existing users...
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)