Thank you very much! You saved my day!
Thanks for the feedback.
For 3.0, this entire area is being overhauled and is much much nicer.
thank you for answering. Maybe you can answer me another question in this context?
As you could see with my forum post, i set up a secured REST Api with Apex and ORDS. Everything went fine and i can now connect to the webservice by using the Authorization flow of oAuth2.
Our use case is to have a java program running in remote environments. These programs will call the webservice and do something with the results. On side of the server i need to know what specific client is connecting to provide only relevant data for the client. I plan to use the oAuth2-3rd-party-registration to achieve this. So for each local installation i would register a new 3rd-party-application and use the client id and secret for the authentication process.
I browsed the APEX_040200 schema to better understand where and how the meta data are stored and found the WWV_FLOW_RT-tables (and the related APEX views) storing all the interesting information. But there is on missing link. Can you tell me how i can determine in SQL/PLSQL (behind the REST method) the identity of the client that is currently connected? Are there any environment variables i can use? The best scenario would be if i would get the current client identifier registered with ORDS, maybe determined by using the current access token.
Thank you for any suggestions.
In danger of sounding like a broken record, in 3.0 everything has changed. We will be installing an ORDS_METADATA schema which hold all the information now. APEX will no longer be required at all.
I'm not sure the template can today know what the client is directly. You would have to get the bearer token and start in wwv_flow_rt$user_sessions. From there to the $approvals which has a client_id in it. Which finally gets you to the $clients table.
Hope that helps.