Skip to content

Add Guide to Secure AWS HTTP APIs Using Asgardeo #5253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Shalindri
Copy link

Purpose

This PR introduces a step-by-step guide for securing AWS HTTP API Gateway endpoints using JWT authentication with WSO2 Asgardeo as the identity provider. It demonstrates a fully CLI-based approach suitable for developers building serverless applications that require secure access control.

@@ -0,0 +1,279 @@
---
template: templates/quick-start.html
heading: Secure a Pharmacy User API with AWS API Gateway and Asgardeo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we keep the heading generic?

Suggested change
heading: Secure a Pharmacy User API with AWS API Gateway and Asgardeo
heading: Securing APIs with AWS API Gateway and Asgardeo

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in e4fc8aa

---
template: templates/quick-start.html
heading: Secure a Pharmacy User API with AWS API Gateway and Asgardeo
description: This guide walks you through securing a Pharmacy User API using AWS API Gateway and WSO2 Asgardeo. You'll deploy a Lambda function, expose it via an HTTP API, and protect the endpoint using JWT validation powered by Asgardeo.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: This guide walks you through securing a Pharmacy User API using AWS API Gateway and WSO2 Asgardeo. You'll deploy a Lambda function, expose it via an HTTP API, and protect the endpoint using JWT validation powered by Asgardeo.
description: This guide walks you through securing a Pharmacy User API using AWS API Gateway and Asgardeo. You'll deploy a Lambda function, expose it via an HTTP API, and protect the endpoint using JWT validation powered by Asgardeo.

JWT validation is independent of Asgardeo, isn't it? in that case, "JWT validation powered by Asgardeo." isn't accurate, IMO

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in e4fc8aa

Comment on lines 5 to 9
what_you_will_learn:
- Deploy a serverless AWS Lambda endpoint
- Secure the API using AWS API Gateway's JWT authorizer
- Configure OAuth2 application and API scopes in Asgardeo
- Protect API access using JWTs and test secured endpoints
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
what_you_will_learn:
- Deploy a serverless AWS Lambda endpoint
- Secure the API using AWS API Gateway's JWT authorizer
- Configure OAuth2 application and API scopes in Asgardeo
- Protect API access using JWTs and test secured endpoints
what_you_will_learn:
- Deploy a serverless endpoint using AWS Lambda
- Secure your API with AWS API Gateways JWT authorizer
- Configure an OAuth2 application and define API scopes in Asgardeo
- Protect and test your API using JWT-based access control

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in e4fc8aa

prerequisites:
- About 20 minutes
- AWS Account with CLI access
- <a href="https://asgardeo.io" target="_blank" rel="noopener noreferrer">Asgardeo account</a>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- <a href="https://asgardeo.io" target="_blank" rel="noopener noreferrer">Asgardeo account</a>
- an <a href="https://asgardeo.io" target="_blank" rel="noopener noreferrer">Asgardeo account</a>

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in e4fc8aa

## Step 1: Create and Deploy the Lambda Function

### 1. Create IAM Role for Lambda Execution
```bash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we add a description?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in e4fc8aa

## Step 3: Obtain a Bearer Token for Asgardeo Manage App

You will need a Client ID and Client Secret from an Asgardeo Manage application that can be used to call Asgardeo’s management APIs. You can use an existing application or create a new Manage application in the Asgardeo console with the Client Credentials grant enabled. Make sure the application has the scope internal_application_mgt_create (this scope is required to create a new application via the API).
```bash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```bash
```bash

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in e4fc8aa


## Step 3: Obtain a Bearer Token for Asgardeo Manage App

You will need a Client ID and Client Secret from an Asgardeo Manage application that can be used to call Asgardeo’s management APIs. You can use an existing application or create a new Manage application in the Asgardeo console with the Client Credentials grant enabled. Make sure the application has the scope internal_application_mgt_create (this scope is required to create a new application via the API).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You will need a Client ID and Client Secret from an Asgardeo Manage application that can be used to call Asgardeo’s management APIs. You can use an existing application or create a new Manage application in the Asgardeo console with the Client Credentials grant enabled. Make sure the application has the scope internal_application_mgt_create (this scope is required to create a new application via the API).
You will need a Client ID and Client Secret from an Asgardeo application that is authorized to invoke Asgardeo management APIs. You can use an existing application or create a new application in the Asgardeo console with the Client Credentials grant enabled. Make sure the application has the scope `internal_application_mgt_create` (this scope is required to create a new application via the API).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in e4fc8aa

-d "grant_type=client_credentials&scope=internal_application_mgt_create" 2>/dev/null | jq -r .access_token
```
Use the obtained token in all subsequent Asgardeo API calls:
```bash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```bash
```bash

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in e4fc8aa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants