on 07-31-2018 9:21 PM
Hey, basically I want to call my ODATA service, but not use the generated methods, because one of them is not behaving right. (I have opened a support incident).
As a workaround, I generated a helper class with https://app.quicktype.io/ with the ODATA json, and am querying that now.
For querying the ODATA service, obviously I will need the oauth token that was recieved during the onboarding/login process. I now need to programatically get this.
For a prototype, I just looked at what request headers the SDK's generated methods use, but of course, that can change depending on the user, so it's a terrible hack.
Tried to look at the docs, tested out things for 2 hours but it didnt work out. Tried to use some of the global variables, but they didn't contain anything helpful.
Links:
Carsten,
The easiest would probably be to use the configured SAPURLSession (with an OAuth2 observer attached) also for connecting to the OData service directly. This way, the OAuth2 token would always be added to outgoing requests.
If this cannot be done, you could implement your own OAuth2TokenStore and configure the OAuth2Observer with it.
If you're using the Flows framework, the OnboardingContext.credentialStore will hold the token after onboarding is completed.
Not sure about your exact scenario - hope any of this is helpful...
Thanks
Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.