This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

AnnouncementAnnouncement Module

Collapse

No announcement yet.

Why 'resouce' in OAuth2RestTemplate is private final (cannot change values)Page Title Module

where WebAppOAuth2ResourceDetails extends AuthorizationCodeResourceDetails.
So far so good - but let's say I cannot pass the params in the ctor, but want to read them (the URIs) from a DB and then update the object (which is the 'resource' inside OAuth2RestTemplate.

I'm not really sure I understand the use case. You wouldn't want to change the resource inside an OAuth2RestTemplate once it is configured because it wouldn't be thread safe. Maybe you just need to change your implementation of the resource, or (if I understand correctly) just get the placeholder properties from somewhere else (like the db you mentioned)?

Comment

I'm not really sure I understand the use case. You wouldn't want to change the resource inside an OAuth2RestTemplate once it is configured because it wouldn't be thread safe. Maybe you just need to change your implementation of the resource, or (if I understand correctly) just get the placeholder properties from somewhere else (like the db you mentioned)?

The thing is my oAuth-client has no DB; instead, he makes a REST call to another component that does use a DB. Therefore, I cannot simply change the placeholder. So on init, I do not know my URLs /authorize and /token, but I read them later on. This is why I need update the resource' URLs inside the OAuth2RestTemplate (I do not need to replace it, just to update it; yet I understand the multi-threading issue here)