Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Extending Oauth2 Client Credentials Flow -

Jon FinkeSep 18 2024

I have to revisit REST authentication for one of my applications that is talking to an external API. Seemed like a good time to make use of the Built In credential management in APEX 23.2 (Oracle - 21.14.0.0.0). The problem I appear to be having is that the external API wants additional fields in the Token Call:

Specifically the grant_type, box_subject_type and box_subject_id (if I post this via Postman, I will get back a token)

But when I set up the credentials via APEX:

There isn't a spot that I can find to add in other parameters. I know that the Token URL is included with the Make_Rest_Request call

l_clob := Apex_Web_Service.Make_Rest_Request(
			p_url => final_query, 
			P_http_method => 'GET',
			p_parm_name => apex_util.string_to_table(rest_pars),
			p_parm_value => apex_util.string_to_table(rest_values),
            p_wallet_path => 'file:' ||  master.wallet_path,
            p_wallet_pwd => Null
            ,p_credential_static_id => 'box_api_2024'
            ,p_token_url => 'https://api.box.com/oauth2/token');

(I don't want to hard code the URL here, but that is a different issue for another task).

So, am I stuck managing tokens and authentication by hand or is there some way to sneak the box fields into the oauth2 request?

Comments
Post Details
Added on Sep 18 2024
0 comments
288 views