Posts

Showing posts with the label REST API

Jumpstarting ORDS REST API Development: A Comprehensive Guide for Beginners - Part 3

Image
In the previous blog, we learned how to secure a REST API using OAuth2 and tested it using Postman. Now, in this blog post, we will take the next step and explore how to invoke a secured REST API using PL/SQL. By the end of this blog post, you will have a clear understanding of how to integrate your PL/SQL applications with OAuth2-secured REST APIs, enabling seamless communication and secure data exchange. So, let's dive into the world of PL/SQL and learn how to interact with OAuth2-protected REST API. One of the greatest advantages of Oracle APEX is its collection of powerful APIs that simplify your development tasks, and one such API is APEX_WEB_SERVICE. This API allows us to easily invoke REST APIs and integrate them into our APEX applications, making our work much more convenient. Before invoking the REST API, it is necessary to create an ACL entry for the external network service. For more detailed information on how to create an ACL entry, refer this blog .  Following the ...

Jumpstarting ORDS REST API Development: A Comprehensive Guide for Beginners - Part 2

Image
In the part 1 of this blog series, we covered the creation of a REST API in Oracle REST Data Services (ORDS). Now, it's time to dive into the crucial aspect of securing our APIs using OAuth2. OAuth2 is an industry-standard protocol used for authorization and authentication in modern web and mobile applications. It provides a secure and standardized way to protect our APIs, ensuring that only authorized clients can access the protected resources. Understanding OAuth2 is essential for developers and architects who want to build secure and reliable APIs. In this blog post, we will start by explaining the core concepts of OAuth2 in simple terms. We will break down the OAuth2 roles, such as the resource owner, client, and authorization server, and how they interact with each other to establish secure communication channels. By the end of this blog post, you will have a solid understanding of OAuth2 and its relevance in securing REST APIs.  So, let's get started and first understan...

Jumpstarting ORDS REST API Development: A Comprehensive Guide for Beginners - Part 1

Image
During my INAOUG Explore webinar on Mastering REST API using Oracle APEX , I discussed the creation of a secure REST API with OAuth2. One attendee asked a question about consuming a secured REST API in Oracle APEX, which was beyond the scope of that session. However, I will address this topic in this blog post. I will begin by creating a REST API and securing it with OAuth2, and then demonstrate how to invoke it using PL/SQL API.  Part 1: Create REST API Part2 : Secure REST API using Oauth2 Part3 : Invoke REST API using PL/SQL Let's get started. I have used the standard "Employees" table from the HR schema. If you have not yet installed this table in your schema, you can do so by following these steps: Go to SQL Workshop in your APEX environment. Navigate to Utilities. Select Sample Datasets. Look for the "HR Data" dataset and choose to install it. By installing the "HR Data" dataset, you will have the necessary table available in your schema. I have...

OTP based Authentication in Oracle APEX using Twilio

Image
Recently, a new requirement came up to implement One Time Password (OTP) based authentication in Oracle APEX. In this, the user will enter his mobile number on the login page and will receive an OTP via SMS. The user will then enter the OTP on the login page and be able to authenticate himself in the APEX app.  When I started working on this requirement, first I identified all the steps that I need to implement for the solution.  Below are the steps that I followed: 1. Generate the OTP and temporarily store it in a database table. 2. Send the generated OTP to the user by integrating REST API to send the SMS 3. Validate the user entered OTP against the OTP that is stored in the table and authenticate the user. 4. Create a Custom Authentication Scheme. 5. Modify the login page. Let's understand each step in more detail. Step 1:  Generate the OTP and temporarily store it in a database table.  First, create a table to temporarily store the OTP for the validation. Here...