Sales Insight is a sample web application used to test the Oracle Identity Cloud Service integration with OAuth2 as a resource server application.
This application is provided “AS IS” with no express or implied warranty for accuracy or accessibility. The sample code is intended to demonstrate the basic integration between Oracle Identity Cloud Service and custom applications and does not represent, by any means, the recommended approach or is intended to be used in development or productions environments.
- Oracle Identity Cloud Service: Integrating a Resource Server Application. In this tutorial, you integrate the Sales Insight with Oracle Identity Cloud Service as a resource server application. This application will be able to integrate with other Client Applications, such as the
Customer Quotes
app.
- Complete the Oracle Identity Cloud Service: Integrating a Custom Client Application. tutorial.
- Create a Web Application in Oracle Identity Cloud Service.
- In Authorization, select only the Client Credentials grant type.
- In the Resources, select Register Resources and enter
http://localhost:8080/salesinsight/
as primary audience. - Register the scopes
quote
,pipeline
,insight
, andreport
. - Save and Activate the application.
- Copy the application client id and client secret.
- Download and extract the salesinsight application.
- Rebuild and Launch the application.
- Access the report request (in Glassfish
http://localhost:8080/salesinsight/report
) and confirm that the app is able to return data. - Stop the application.
- In
ResourceServerConfig.java
, update theCLIENT_ID
, theCLIENT_SECRET
, and theIDCS_URL
with values according to your Oracle Identity Cloud Service instance. - In the
web.xml
, uncomment the AccessTokenValidator snippet. - Rebuild and Launch the salesinsight application. In the Server Logs, you should see the message
Signing Key from IDCS successfully loaded!
- Access the application. Sales Insight should return the message
Error While Validating Token: No access token provided
.
- In Oracle Identity Cloud Service, edit the Customer Quotes's application to include all scopes from the
Sales Insight
application. - In the cquotes application, open the
ClientConfig.java
file and change theIS_RESOURCE_SERVER_ACTIVE
value totrue
. - Rebuild and Launch the cquotes application.
- Access the application (in Glassfish:
https://localhost:8181/cquotes
). - After login, you should see few buttons. Each button, explores an API endpoint provided by the Sales Insight app.
Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
You may not use the identified files except in compliance with the Universal Permissive License (UPL), Version 1.0 (the "License.")
You may obtain a copy of the License at https://opensource.org/licenses/UPL.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and limitations under the License.