Authenticate
Oracle Content Management provides two ways to authenticate using either OAuth or certificate authority (CA) certificate, issued by Verisign, to enable clients to connect securely to the server.
Note:
Ensure that you have the appropriate sign-on credentials for creating, managing, and deleting Oracle Content Management instances, as described in Quick Start.
Using OAuth
Setting up your request to use OAuth is a two-step process. First, you obtain an OAuth token, and then you use this token to access the REST API.
-  From a browser, enter this URL: https://Content Management URL:port/documents/web?IdcService=GET_OAUTH_TOKENThe documents/webcontext is protected by Oracle Identity Cloud Services (IDCS). The user will be prompted to sign in to IDCS unless there is already a valid IDCS session in the browser.The OAuth token is returned in the tokenValuefield in the JSON response. The token is valid for 7 days, and the expiration is in seconds.
-  To use the token and access Conversations REST endpoints, use the Bearer Authorization header. For example: curl -i -H 'Authorization: Bearer token' --request GET {Content Management URL}/api/1.2/folders/items
The OAuth token can also be obtained directly from IDCS through the OAuth client application. OAuth client is simply an HTTP client that must be registered as an OAuth 2 client using the Oracle Identity Cloud Service (IDCS) or IAM Identity Domain administration console. See Integrate with Oracle Content Management Using OAuth.
Using CA
-  An SSL certificate authority (CA) certificate file or bundle to authenticate against the Verisign CA certificate. 
-  User name and password for your Oracle Content Management account. 
-  Custom header. 
For example, to authenticate using cURL:
-  Set the cURL environment variable, CURL_CA_BUNDLE, to the location of your local CA certificate bundle. For information about CA certificate verification using cURL, see http://curl.haxx.se/docs/sslcerts.html.
-  Pass the user name and password for your Oracle Content Management account, using the -ucURL option or in the header.
-  Pass the custom request header, using the -HcURL option.
curl -L -i -c mycookies.jar -b mycookies.jar -H 'Authorization:encoded username:password' -H "Content-Type: application/json" -H "Accept: application/json" -X GET https://Content and Experience URL/osn/social/api
In the command, 'encoded username:password' is the base64 encode for username:password. If the preceding request has succeeded, you will have the valid user session stored in the cookies. 
Now you do a POST with an empty payload to the Connections REST endpoint to obtain the ApiRandomID.
curl -L -i -c mycookies.jar -b mycookies.jar -H "Content-Type: application/json" -H "Accept: application/json" -X POST https://Content Management Cloud URL/osn/social/api/connections -D ""
Then use the value in the request header for subsequent requests.