-
Notifications
You must be signed in to change notification settings - Fork 6
docs: add Asgardeo provider guide #74
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
xiaoyijun
wants to merge
1
commit into
master
Choose a base branch
from
xiaoyijun-docs-asgardeo-provider
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| --- | ||
| sidebar_position: 3 | ||
| sidebar_label: Asgardeo | ||
| --- | ||
|
|
||
| # Asgardeo | ||
|
|
||
| [Asgardeo](https://wso2.com/asgardeo) is a cloud-native identity as a service (IDaaS) platform that supports OAuth 2.0 and OpenID Connect (OIDC), providing robust identity and access management for modern applications. | ||
|
|
||
| :::note | ||
| If you don't have an Asgardeo account, you can [sign up for free](https://asgardeo.io). | ||
| ::: | ||
|
|
||
| ## Get issuer URL {#get-issuer-url} | ||
|
|
||
| You can find the issuer URL in the Asgardeo Console: | ||
|
|
||
| 1. Log in to the [Asgardeo Console](https://console.asgardeo.io) and select your organization | ||
| 2. Navigate to the created application and open the **Info** tab | ||
| 3. The **Issuer** field will be displayed there | ||
|
|
||
| The issuer URL should look like: | ||
|
|
||
| ``` | ||
| https://api.asgardeo.io/t/<your-organization-name>/oauth2/token | ||
| ``` | ||
|
|
||
| You can also discover this endpoint dynamically via the [OIDC discovery endpoint](https://wso2.com/asgardeo/docs/guides/authentication/oidc/discover-oidc-configs). | ||
|
|
||
| ## Create API resource and scopes {#create-api-resource-and-scopes} | ||
|
|
||
| Asgardeo supports Role-Based Access Control (RBAC) and fine-grained authorization using API resources and scopes. | ||
|
|
||
| 1. Log in to the [Asgardeo Console](https://console.asgardeo.io) and select your organization | ||
| 2. Navigate to **API Authorization** in the left menu | ||
| 3. Click **New API Resource** and fill in the details: | ||
| - **Identifier**: Your MCP server URL, e.g., `http://localhost:3001/` | ||
| - **Display Name**: e.g., "Todo Manager" | ||
| 4. Add the scopes your MCP server needs, e.g.: | ||
| - `create:todos`: "Create new todo items" | ||
| - `read:todos`: "Read all todo items" | ||
| - `delete:todos`: "Delete any todo item" | ||
| 5. Click **Create** | ||
|
|
||
| The scopes will be included in the JWT access token's `scope` claim as a space-separated string. | ||
|
|
||
| ## Create roles {#create-roles} | ||
|
|
||
| Roles make it easier to manage permissions for groups of users: | ||
|
|
||
| 1. Navigate to **User Management > Roles** in the left menu | ||
| 2. Click **New Role** | ||
| 3. Create roles with appropriate scopes, e.g.: | ||
| - **Admin**: Assign all scopes (`create:todos`, `read:todos`, `delete:todos`) | ||
| - **User**: Assign limited scopes (e.g., only `create:todos`) | ||
| 4. For each role, select the scopes from your API resource | ||
|
|
||
| Alternatively, you can configure roles at the application level: | ||
|
|
||
| 1. Navigate to **Applications** and select your application | ||
| 2. Go to the **Roles** tab | ||
| 3. Select "Application Role" as the audience type | ||
| 4. Create and configure roles with their respective scope assignments | ||
|
|
||
| ## Assign roles to users {#assign-roles-to-users} | ||
|
|
||
| 1. Navigate to **User Management > Roles** | ||
| 2. Select a role (e.g., "Admin" or "User") | ||
| 3. Go to the **Users** tab | ||
| 4. Click **Assign User** and select the users to assign to this role | ||
|
|
||
| ## Retrieving user identity {#retrieving-user-identity} | ||
|
|
||
| User information is encoded inside the ID token returned along with the access token. But as an OIDC provider, Asgardeo exposes a [UserInfo endpoint](https://wso2.com/asgardeo/docs/guides/authentication/oidc/request-user-info/) that allows applications to retrieve claims about the authenticated user in the payload. | ||
|
|
||
| To fetch an access token that can be used to access the userinfo endpoint, at least two scopes are required: `openid` and `profile`. | ||
|
|
||
| ## Register MCP client {#register-mcp-client} | ||
|
|
||
| While Asgardeo supports dynamic client registration via a standard API, the endpoint is protected and requires an access token with the necessary permissions. You'll need to register the client manually through the Asgardeo Console. | ||
|
|
||
| ### Register a client for VS Code | ||
|
|
||
| 1. Log in to the [Asgardeo Console](https://console.asgardeo.io) and select your organization | ||
| 2. Create a new application: | ||
| - Go to **Applications** → **New Application** | ||
| - Choose **Standard-Based Application** → **OAuth 2.0/OpenID Connect** | ||
| - Enter an application name like `VS Code` | ||
| - In the **Authorized Redirect URLs** field, add: | ||
| - `http://127.0.0.1` | ||
| - `https://vscode.dev/redirect` | ||
| - Click **Create** | ||
| 3. Configure the protocol settings: | ||
| - Under the **Protocol** tab: | ||
| - Copy the **Client ID** for later use | ||
| - Ensure switching to `JWT` for the `Token Type` in **Access Token** section | ||
| - Click **Update** | ||
| 4. Configure API authorization (if using RBAC): | ||
| - Go to the **API Authorization** tab | ||
| - Authorize the API resource you created earlier | ||
| - Select the scopes the application can request | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can refer to the MCP Client Application. template instead of standard based. Refer: https://wso2.com/asgardeo/docs/guides/agentic-ai/mcp/register-mcp-client-app/