-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XsuaaTokenFlows: Deprecated constructors for client credential based authentication #707
Comments
Hi @hoffmannsv007
The deprecation from
instead of deprecated class
Kind regards, |
The fix will be released with version 2.11.3 version. |
Reopen, as it is not yet released. |
Hi @hoffmannsv007 |
@nenaraab We also face the same issue reported here (already raised an issue #701). |
Hi @shravanpishike Finally, instead of XsuaaTokenFlows tokenFlows =
new XsuaaTokenFlows(
new DefaultOAuth2TokenService(),
new XsuaaDefaultEndpoints(uaaUrl),
new ClientCredentials(clientId, clientSecret)); ...instantiate ClientIdentity identity = new ClientCredentials(clientId, clientSecret);
XsuaaTokenFlows tokenFlows =
new XsuaaTokenFlows(
new DefaultOAuth2TokenService(HttpClientFactory.create(identity)),
new XsuaaDefaultEndpoints(uaaUrl, null), // available as of 2.11.3
identity
); |
@hoffmannsv007 |
Hello Colleagues,
could you please provide an example for the proper usage of Example Usage of XsuaaServiceConfiguration?
The background of this request is the following:
We have developed a service which in turn is calling an instance of the Market Rates Management (MRM) service. For the MRM call we first get the access token from the uaa instance bound to the MRM service. Currently we use the following coding for this purpose:
In this solution
uaaUrl
,clientId
andclientSecret
are coming fromuaa
environment variables (VCAP_SERVICES):The solution was/is working as expected but unfortunately the used constructor version of XsuaaTokenFlows is now deprecated. For the alternative constructor we need an instance of OAuth2ServiceConfigurationProperties. I have seen that XsuaaServiceConfiguration is a specialization of OAuth2ServiceConfigurationProperties. My question now is, how do we get a proper instance of XsuaaServiceConfiguration?
Seeing that the SpringBoot annotation @ConfigurationProperties("sap.security.services.xsuaa") is used I’m wondering from where the properties are really taken from and how can I get an instance which then contains the uaa-credentials of the MRM service and not the ones of my own service?
And maybe one additional remark: at the end my own service should be called from the BTP Job Scheduler - I'm not sure if this adds additional complexity for getting the MRM credentials.
Thanks in advance for your help!
Best regards,
Sven.
P.S.: If have seen that there was already a similar question raised but this doesn't answer my question above.
The text was updated successfully, but these errors were encountered: