Test the Node.js Application
In this section of the solution, you:
-
Register the sample Node.js web application to integrate it with Oracle Identity Cloud Service for authentication
-
Set up the application to make it use Oracle Identity Cloud Service's SDK for the Node.js programming language
-
Prepare, run, and test the application
Register the Node.js Application
To establish communication with Oracle Identity Cloud Service, the sample Node.js web application needs a Client ID and Secret. You also need to configure API permissions to grant to the application.
Set up the Node.js Application
Update the code of the sample Node.js application to make it use Oracle Identity Cloud Service's SDK for the Node.js programming language.
Edit the c:\temp\nodejs\auth.js
file, update the file with the following content, and then save the file.
//Oracle Identity Cloud Service connection parameters as a json var
var ids = {
oracle: {
"ClientId": '123456789abcdefghij',
"ClientSecret": 'abcde-12345-zyxvu-98765-qwerty',
"ClientTenant": 'idcs-abcd1234',
"IDCSHost": 'https://%tenant%.identity.oraclecloud.com',
"AudienceServiceUrl" : 'https://idcs-abcd1234.identity.oraclecloud.com',
"TokenIssuer": 'https://identity.oraclecloud.com/',
"scope": 'urn:opc:idm:t.user.me openid',
"logoutSufix": '/oauth2/v1/userlogout',
"redirectURL": 'http://localhost:3000/callback'
}
};
module.exports = ids;
For the ClientId
and ClientSecret
parameter values, use the Client ID and Client Secret that Oracle Identity Cloud Service generated when you registered your Node.js web application. You can obtain the values for the ClientTenant
, IDCSHost
, and AudienceServiceURL
parameters from the Learn About Methods and Functions topic of this solution.