diff --git a/plugins/auth-oauth2/README.md b/plugins/auth-oauth2/README.md new file mode 100644 index 00000000..6fe41a17 --- /dev/null +++ b/plugins/auth-oauth2/README.md @@ -0,0 +1,72 @@ +# OAuth 2.0 Authentication + +An [OAuth 2.0](https://datatracker.ietf.org/doc/html/rfc6749) authentication plugin that +supports multiple grant types and flows, enabling secure API authentication with OAuth 2.0 +providers. + +![Screenshot of OAuth 2.0 auth UI](screenshot.png) + +## Overview + +This plugin implements OAuth 2.0 authentication for requests, supporting the most common +OAuth 2.0 grant types used in modern API integrations. It handles token management, +automatic refresh, and [PKCE](https://datatracker.ietf.org/doc/html/rfc7636) (Proof Key +for Code Exchange) for enhanced security. + +## Supported Grant Types + +### Authorization Code Flow + +The most secure and commonly used OAuth 2.0 flow for web applications. + +- Standard Authorization Code flow +- Optional PKCE (Proof Key for Code Exchange) for enhanced security +- Supports automatic token refresh + +### Client Credentials Flow + +Ideal for server-to-server authentication where no user interaction is required. + +### Implicit Flow + +Legacy flow for single-page applications (deprecated but still supported): + +- Direct access token retrieval +- No refresh token support +- Suitable for legacy integrations + +### Resource Owner Password Credentials Flow + +Direct username/password authentication. + +- User credentials are exchanged directly for tokens +- Should only be used with trusted applications +- Supports automatic token refresh + +## Features + +- **Automatic Token Management**: Handles token storage, expiration, and refresh + automatically +- **PKCE Support**: Enhanced security for Authorization Code flow +- **Token Persistence**: Stores tokens between sessions +- **Flexible Configuration**: Supports custom authorization and token endpoints +- **Scope Management**: Configure required OAuth scopes for your API +- **Error Handling**: Comprehensive error handling and user feedback + +## Usage + +1. Configure the request, folder, or workspace to use OAuth 2.0 Authentication +2. Select the appropriate grant type for your use case +3. Fill in the required OAuth 2.0 parameters from your API provider +4. The plugin will handle the authentication flow and token management automatically + +## Compatibility + +This plugin is compatible with OAuth 2.0 providers including: + +- Google APIs +- Microsoft Graph +- GitHub API +- Auth0 +- Okta +- And many other OAuth 2.0 compliant services diff --git a/plugins/auth-oauth2/package.json b/plugins/auth-oauth2/package.json index 336a11d6..b2226881 100644 --- a/plugins/auth-oauth2/package.json +++ b/plugins/auth-oauth2/package.json @@ -2,6 +2,11 @@ "name": "@yaak/auth-oauth2", "displayName": "OAuth 2.0 Authentication", "description": "Authenticate requests using OAuth 2.0", + "repository": { + "type": "git", + "url": "https://github.com/mountain-loop/yaak.git", + "directory": "plugins/auth-oauth2" + }, "private": true, "version": "0.1.0", "scripts": { diff --git a/plugins/auth-oauth2/screenshot.png b/plugins/auth-oauth2/screenshot.png new file mode 100644 index 00000000..3ba1dbd0 Binary files /dev/null and b/plugins/auth-oauth2/screenshot.png differ