|
| 1 | +# Penneo Pluto - Sandbox OAuth API Connector |
| 2 | + |
| 3 | +Penneo provides a powerful REST API for digital signing and document management. Using this API, you can obtain JWT access tokens for authenticating with Penneo's integration APIs. Very often, you may want to leverage Penneo's authentication capabilities in your application, or in your process automation to securely access Penneo services. |
| 4 | + |
| 5 | +## Publisher: Penneo |
| 6 | + |
| 7 | +## Prerequisites |
| 8 | + |
| 9 | +To use this connector, you will need: |
| 10 | + |
| 11 | +- A Penneo sandbox account with admin access |
| 12 | +- Client ID and Client Secret from Penneo Support |
| 13 | +- Company API Key and API Secret from your Penneo account |
| 14 | + |
| 15 | +## Supported Operations |
| 16 | + |
| 17 | +### Get an access token |
| 18 | +Exchanges API keys for a JWT access token that can be used to authenticate with Penneo's integration APIs. This operation implements Penneo's custom OAuth flow using API keys, which exchanges your client credentials and API keys for a JWT access token. |
| 19 | + |
| 20 | +## Obtaining Credentials |
| 21 | + |
| 22 | +Penneo OAuth APIs use a custom authentication flow with API keys. You need to obtain the necessary credentials from Penneo to identify your connector to Penneo's OAuth service so that it can exchange credentials for a JWT access token. You can read more about this here: https://penneo.readme.io/docs/using-oauth#api-keys-grant |
| 23 | + |
| 24 | +### Step 1: Obtain Client ID and Client Secret |
| 25 | + |
| 26 | +1. **Contact Penneo Support**: Request OAuth client credentials for your application |
| 27 | + - Email: [email protected] (or use your Penneo support channel / https://www.support.penneo.com/hc/en-gb/requests/new) |
| 28 | + - Request: "I need OAuth client credentials (client_id and client_secret) for my Power Platform connector integration" |
| 29 | + - Provide details about your use case and integration requirements |
| 30 | + |
| 31 | +2. **Receive Credentials**: Penneo Support will provide you with: |
| 32 | + - `client_id`: Your OAuth client identifier |
| 33 | + - `client_secret`: Your OAuth client secret (keep this secure) |
| 34 | + |
| 35 | +### Step 2: Enable and Obtain API Keys |
| 36 | + |
| 37 | +1. **Log in to Penneo Sandbox**: |
| 38 | + - Navigate to https://sandbox.penneo.com |
| 39 | + - Log in with your company admin account |
| 40 | + |
| 41 | +2. **Enable API Keys**: |
| 42 | + - Go to Settings → Profile → User Details |
| 43 | + - Or navigate directly to: https://sandbox.penneo.com/settings/profile/user/details |
| 44 | + - Enable API Keys feature and refresh the page (if not already enabled) |
| 45 | + - Note: You must be a company administrator to enable API keys |
| 46 | + |
| 47 | +3. **Retrieve API Credentials**: |
| 48 | + - From the API Keys tab, copy your: |
| 49 | + - `api_key`: Your company API key |
| 50 | + - `api_secret`: Your company API secret (keep this secure) |
| 51 | + |
| 52 | +## Getting Started |
| 53 | + |
| 54 | +### Obtaining an Access Token |
| 55 | + |
| 56 | +1. **Setup Connection**: |
| 57 | + - Create a new connection to "Penneo Pluto Authenticator" |
| 58 | + - Enter all four required credentials: |
| 59 | + - Client ID |
| 60 | + - Client Secret |
| 61 | + - API Key |
| 62 | + - API Secret |
| 63 | + |
| 64 | +2. **Call the Operation**: |
| 65 | + - Use the "Get an access token" operation |
| 66 | + - The connector will automatically: |
| 67 | + - Generate the required nonce and digest |
| 68 | + - Format the request correctly |
| 69 | + - Exchange credentials for a token |
| 70 | + |
| 71 | +3. **Use the Token**: |
| 72 | + - Extract the `access_token` from the response |
| 73 | + - Use this JWT token in the `X-Auth-Token` header when calling other Penneo APIs |
| 74 | + - Note the `expires_in` value to know when to refresh the token |
| 75 | + |
| 76 | +## How the OAuth Flow Works |
| 77 | + |
| 78 | +This connector implements Penneo's custom OAuth flow as described on https://penneo.readme.io/docs/using-oauth#api-keys-grant: |
| 79 | + |
| 80 | +1. **Input**: Receives `client_id`, `client_secret`, `api_key`, and `api_secret` |
| 81 | + |
| 82 | +2. **Digest Generation (WSSE)**: |
| 83 | + - Generates a random 8-byte nonce |
| 84 | + - Creates a timestamp in ISO 8601 format |
| 85 | + - Concatenates: nonce + timestamp + api_secret |
| 86 | + - Computes SHA-1 hash of the concatenated bytes |
| 87 | + - Base64 encodes the hash to create the digest |
| 88 | + |
| 89 | +3. **Token Request**: |
| 90 | + - Sends POST request to `https://sandbox.oauth.penneo.cloud/oauth/token` |
| 91 | + - Request body includes: |
| 92 | + - `client_id` |
| 93 | + - `client_secret` |
| 94 | + - `grant_type`: "api_keys" |
| 95 | + - `key`: api_key |
| 96 | + - `nonce`: Generated nonce |
| 97 | + - `created_at`: Timestamp |
| 98 | + - `digest`: Generated digest |
| 99 | + |
| 100 | +4. **Response**: Returns a JWT access token with: |
| 101 | + - `access_token`: The JWT token for API authentication |
| 102 | + - `token_type`: "Bearer" |
| 103 | + - `expires_in`: Token lifetime in seconds |
| 104 | + - `access_token_expires_at`: Unix timestamp of expiration |
| 105 | + |
| 106 | +## Known Issues and Limitations |
| 107 | + |
| 108 | +1. **Token Expiration**: Access tokens expire(currently every 600s). Monitor the `expires_in` or `access_token_expires_at` fields and refresh tokens before expiration. |
| 109 | + |
| 110 | +2. **Sandbox Environment**: This connector is configured for the Penneo sandbox environment (`sandbox.oauth.penneo.cloud`). |
| 111 | + |
| 112 | +3. **Digest Algorithm**: WSSE - the connector uses SHA-1 for digest generation as required by Penneo's API. This is a requirement of the Penneo API specification. |
| 113 | + |
| 114 | +4. **Credential Security**: |
| 115 | + - Never hardcode credentials in your flows or apps |
| 116 | + - Use secure connection storage provided by Power Platform |
| 117 | + - Rotate credentials if compromised |
| 118 | + |
| 119 | +5. **Nonce Generation**: Each token request generates a unique nonce. The connector handles this automatically. |
| 120 | + |
| 121 | +## Security Considerations |
| 122 | + |
| 123 | +- **Client Secret and API Secret**: These are sensitive credentials. Store them securely in Power Platform connection settings, never in code or logs. |
| 124 | +- **Token Storage**: Access tokens should be stored securely and not logged or exposed. |
| 125 | + |
| 126 | +## Deployment Instructions |
| 127 | + |
| 128 | +Run the following commands and follow the prompts: |
| 129 | + |
| 130 | +``` |
| 131 | +paconn create --api-def apiDefinition.swagger.json --api-prop apiProperties.json --icon icon.png --script script.csx |
| 132 | +``` |
0 commit comments