Skip to content

Commit d1ad5ff

Browse files
committed
MPDO-1015: incorporated review comments
1 parent 41dc0e9 commit d1ad5ff

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

samples/oci-apigw-idcs-auth-basic/README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# API Gateway Basicauth function using IDCS
1+
# API Gateway Basicauth function using Identity Cloud Service (IDCS)
22

33
This function provides verification of username and password against IDCS at runtime and allows only authorized users to access API gateway deployment.
44

5-
The implementation conforms to the guidelines in the OCI Documentation at https://docs.cloud.oracle.com/en-us/iaas/Content/APIGateway/Tasks/apigatewayusingauthorizerfunction.htm.
5+
The implementation conforms to the [documented guidlines for using authorizer functions to add Authentication and Authorization to API deployments](https://docs.cloud.oracle.com/en-us/iaas/Content/APIGateway/Tasks/apigatewayusingauthorizerfunction.htm).
66

77
As you make your way through this tutorial, look out for this icon ![user input icon](./images/userinput.png).
88
Whenever you see it, it's time for you to perform an action.
@@ -11,7 +11,7 @@ Whenever you see it, it's time for you to perform an action.
1111

1212
[Create users in IDCS](https://docs.oracle.com/en/cloud/paas/identity-cloud/uaids/create-user-accounts.html)
1313

14-
Before you deploy this sample function, make sure you have run step A, B and C of the [Oracle Functions Quick Start Guide for Cloud Shell](https://www.oracle.com/webfolder/technetwork/tutorials/infographics/oci_functions_cloudshell_quickview/functions_quickview_top/functions_quickview/index.html)
14+
Before you deploy this sample function, you need to complete steps A, B and C of the [Oracle Functions Quick Start Guide for Cloud Shell](https://www.oracle.com/webfolder/technetwork/tutorials/infographics/oci_functions_cloudshell_quickview/functions_quickview_top/functions_quickview/index.html)
1515

1616
- A - Set up your tenancy
1717
- B - Create application
@@ -29,8 +29,8 @@ fn ls apps
2929
## Deploy a function that implements an API
3030

3131
We need another function that will be a target for API Gateway. We suggest [oci-display-httprequest-info-python](../oci-display-httprequest-info-python).
32-
In Cloud Shell, run the _fn deploy_ command to build the function and its dependencies as a Docker image,
33-
push the image to OCIR, and deploy the function to Oracle Functions in your application.
32+
In Cloud Shell, run `fn deploy` to build the function and its dependencies as a container,
33+
push the image to Oracle Cloud Infrastructure Registry (OCIR), and deploy the function to Oracle Functions in your application.
3434

3535
![user input icon](./images/userinput.png)
3636

@@ -108,11 +108,11 @@ Note the _IDCS URL_, this is the URL you see in your browser URL bar, copy the I
108108

109109
Review the following files in the current folder:
110110

111-
- [pom.xml](./pom.xml) specifies all the dependencies for your function
112-
- [func.yaml](./func.yaml) that contains metadata about your function and declares properties
113-
- [src/main/java/com/example/fn/BasicAuth.java](./src/main/java/com/example/fn/BasicAuth.java) which contains the Java code
111+
- [`pom.xml`](./pom.xml) specifies all the dependencies for your function
112+
- [`func.yaml`](./func.yaml) that contains metadata about your function and declares properties
113+
- [`src/main/java/com/example/fn/BasicAuth.java`](./src/main/java/com/example/fn/BasicAuth.java) which contains the Java code
114114

115-
The name of your function _basicauth_ is specified in [func.yaml](./func.yaml).
115+
The name of your function `basicauth` is specified in [`func.yaml`](./func.yaml).
116116

117117
set the following config variables to the values noted while configuring IDCS. The IDCS URL is the token endpoint that returns the access token after validating credentials
118118

@@ -127,7 +127,7 @@ SCOPE_AUD = "display-httprequest-infodisplay-httprequest-info";
127127

128128
For the unit test to run, set the following variables in src/test/java/com/example/fn/BasicAuthTest.java
129129

130-
```
130+
```java
131131
private static final String TEST_IDCS_URL = "https://idcs-xxxxxxxx.identity.oraclecloud.com/oauth2/v1/token";
132132
private static final String TEST_CLIENT_ID = "xxxxxxxxxxx";
133133
private static final String TEST_CLIENT_SECRET = "xxxxxxxxxxx";
@@ -137,22 +137,22 @@ For the unit test to run, set the following variables in src/test/java/com/examp
137137

138138
## Deploy the basicauth function
139139

140-
In Cloud Shell, run the _fn deploy_ command to build the function and its dependencies as a Docker image,
140+
In Cloud Shell, run `fn deploy` to build the function and its dependencies as a container,
141141
push the image to OCIR, and deploy the function to Oracle Functions in your application.
142142

143143
![user input icon](./images/userinput.png)
144144

145-
```
145+
```shell
146146
fn -v deploy --app <app-name>
147147
```
148148

149149
## Invoke the basicauth function in cloud shell
150150

151-
In Cloud Shell, run _fn invoke_ command to invoke the deployed function, returns active status as true if the token is valid or else returns false.
151+
In Cloud Shell, run `fn invoke` to invoke the deployed function. It should return an active status of true if the token is valid or otherwise returns false.
152152

153153
![user input icon](./images/userinput.png)
154154

155-
```
155+
```shell
156156
echo -n '{"type":"TOKEN", "token":"Basic aW5jaGFyYS5zaGFtYW5uYUBvcmFj....."}' | fn invoke <app-name> <func-name>
157157
```
158158

@@ -194,9 +194,9 @@ The function validates if the user information is valid.
194194

195195
![user input icon](./images/userinput.png)
196196

197-
Use the curl command to make the HTTP request
197+
Use `curl` to make the HTTP request
198198

199-
```
199+
```shell
200200
curl -i -u "<username>:<password>" https://d6xxxxxxxxk64.apigateway.us-ashburn-1.oci.customer-oci.com/basicauth/hello
201201
```
202202

0 commit comments

Comments
 (0)