Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
a32c2b5
Contributing a new block: boilerplate
gorohoroh Sep 11, 2025
6d814c0
Examples of PRs, OpenOps vs Activepieces
gorohoroh Sep 11, 2025
d296ed1
Started listing steps
gorohoroh Sep 12, 2025
b54f973
Merge branch 'main' into contributing
gorohoroh Oct 2, 2025
db1d087
Contributing a block: setting up Codespaces
gorohoroh Oct 2, 2025
bbf20c1
Contributing a block: scaffolding a block
gorohoroh Oct 3, 2025
42a5000
Contributing a block: create an action, reference it from block defin…
gorohoroh Oct 3, 2025
a438cd6
Contributing a block: formatting summaries of scaffolded block's files
gorohoroh Oct 3, 2025
889bd1e
Contributing a block: pieces -> blocks
gorohoroh Oct 3, 2025
bc75f07
Contributing a block: splitting into several pages
gorohoroh Oct 3, 2025
903c529
Merge branch 'main' into contributing
gorohoroh Oct 6, 2025
8086ae1
YouTrack integration: scaffolding a block with auth, fixing generated…
gorohoroh Oct 6, 2025
f2abdff
Merge branch 'main' into contributing
gorohoroh Oct 7, 2025
cab06b5
Merge branch 'main' into contributing
gorohoroh Oct 9, 2025
3e4a558
YouTrack integration: tabs with generated files (in progress)
gorohoroh Oct 17, 2025
40616e4
YouTrack integration: more on scaffolding a block and cleanup
gorohoroh Oct 19, 2025
aa7606d
YouTrack integration: auth/connection in progress
gorohoroh Oct 19, 2025
130ac9f
YouTrack integration: description of scaffolded files and dumping tab…
gorohoroh Oct 19, 2025
4480eab
YouTrack integration: implementing auth (in progress)
gorohoroh Oct 19, 2025
acc20ba
YouTrack integration: outlining the work ahead
gorohoroh Oct 19, 2025
2442a7d
YouTrack integration: auth: custom validation
gorohoroh Oct 20, 2025
48d5c00
YouTrack integration: auth: Markdown description
gorohoroh Oct 20, 2025
0533243
YouTrack integration: auth: a TS interface and the resulting UI
gorohoroh Oct 20, 2025
c34fb59
Authentication: draft
gorohoroh Oct 20, 2025
ace158e
Authentication: all reviewed except for OAuth2
gorohoroh Oct 20, 2025
a792b63
Authentication: OAuth2
gorohoroh Oct 20, 2025
da96485
Authentication: review
gorohoroh Oct 20, 2025
fda5c2c
Authentication: proofreading
gorohoroh Oct 20, 2025
3a10e65
Adding the "Get All Issues" action
gorohoroh Oct 20, 2025
5183693
Coniguring a minimal block: typo fix
gorohoroh Oct 20, 2025
fb6fdf5
Package.json: a note on adding dependencies
gorohoroh Oct 20, 2025
0cbdf13
YouTrack integration: Change Issue Status: scaffolding, adding an int…
gorohoroh Oct 20, 2025
cb3648b
YouTrack integration: Change Issue Status: adding an input property
gorohoroh Oct 21, 2025
bbfe615
YouTrack integration: Change Issue Status: adding a new status property
gorohoroh Oct 21, 2025
4f62382
YouTrack integration: Change Issue Status: action execution logic
gorohoroh Oct 21, 2025
c703d66
YouTrack integration: Change Issue Status: full listing
gorohoroh Oct 21, 2025
e65da0c
YouTrack integration: intro and summary
gorohoroh Oct 21, 2025
5403c7d
Development environment: Codespaces quirks
gorohoroh Oct 21, 2025
9eaa6dd
Overview: "how to contribute" and links to other articles in the sect…
gorohoroh Oct 21, 2025
2beafa7
Minimal block: review and linking to "contributing an integration"
gorohoroh Oct 21, 2025
eb71604
Contribution overview: proofreading
gorohoroh Oct 21, 2025
024506d
Dev environment: proofreading
gorohoroh Oct 21, 2025
29605eb
Creating a minimal block: proofreading
gorohoroh Oct 21, 2025
fe2c052
Contributing an integration: proofreading
gorohoroh Oct 21, 2025
fbac56c
Icons to make Tom's inner designer happy
gorohoroh Oct 22, 2025
3ee18af
Addressing review feedback
gorohoroh Oct 27, 2025
b407866
Second round of addressing review feedback
gorohoroh Oct 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 151 additions & 0 deletions contributing/authentication.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
---
title: 'Authentication'
description: 'Block authentication methods supported by OpenOps'
icon: 'shield'
---

OpenOps supports several forms of authentication for blocks: **basic**, **secret-based**, **custom**, and **OAuth2**.

Block authentication defines which credentials the user must enter to log in to the API that your block integrates with. Once authentication is implemented for your block, the user can create a [connection](/cloud-access/access-levels-permissions). Apart from implementing authentication, no additional setup is required to enable the connection UI.

Authentication for a block must be defined using the `auth` parameter in the `createBlock` function within your block definition, as well as in all `createAction` functions within your action definitions.

Each block can use only one authentication type.

## Basic authentication

This authentication type collects a username and password as two separate fields. It can also be used to pass an API key and an API secret, or similar pairs of public/private credentials, in which case they are sent in the HTTP `Authorization: Basic` header.

```typescript
BlockAuth.BasicAuth({
required: true,
authProviderKey: 'myservice',
authProviderDisplayName: 'My Service',
authProviderLogoUrl: 'https://static.openops.com/blocks/myservice.png',
description: '',
username: {
displayName: 'Username',
description: 'Enter your username',
},
password: {
displayName: 'Password',
description: 'Enter your password',
},
})
```

The connection UI for this authentication type requests two credentials, typically a username and a password:

![Connection UI - basic authentication](/images/contributing/connection-basic.png)

Basic authentication is not currently used in any OpenOps blocks.

## Secret-based authentication

Use secret-based authentication when an API key is all that's required to authenticate with a service you're integrating with, and the service's base URL is always the same.

This authentication type is used by many OpenOps blocks, including [CloudHealth](https://github.com/openops-cloud/openops/blob/main/packages/blocks/cloudhealth/src/lib/auth.ts), [CloudZero](https://github.com/openops-cloud/openops/blob/main/packages/blocks/cloudzero/src/lib/auth.ts), [Flexera](https://github.com/openops-cloud/openops/blob/main/packages/blocks/flexera/src/auth.ts), [Linear](https://github.com/openops-cloud/openops/blob/main/packages/blocks/linear/src/index.ts), [Monday.com](https://github.com/openops-cloud/openops/blob/main/packages/blocks/monday/src/index.ts), [nOps](https://github.com/openops-cloud/openops/blob/main/packages/blocks/nops/src/lib/auth.ts), and [Vantage](https://github.com/openops-cloud/openops/blob/main/packages/blocks/vantage/src/lib/auth.ts).

```typescript
BlockAuth.SecretAuth({
displayName: 'API Key',
required: true,
authProviderKey: 'myservice',
authProviderDisplayName: 'My Service',
authProviderLogoUrl: 'https://static.openops.com/blocks/myservice.png',
description: '',
// Optional validation
validate: async ({ auth }) => {
if (auth.startsWith('sk_')) {
return {
valid: true,
};
}
return {
valid: false,
error: 'Invalid API Key',
};
},
})
```

The connection UI for this authentication type only requests an API key:

![Connection UI - secret authentication](/images/contributing/connection-secret.png)

## Custom authentication

This type of authentication allows collecting multiple properties, such as a base URL and an access token. Use this type when you need the user to enter more than just an API key.

In OpenOps, this is currently the most commonly used authentication type. It's used by blocks such as [AWS](https://github.com/openops-cloud/openops/blob/950ce3eaecf0d5f991f5828ab82f0cfc91bfe01b/packages/openops/src/lib/aws/auth.ts#L169), [Azure](https://github.com/openops-cloud/openops/blob/main/packages/openops/src/lib/azure/auth.ts), [Google Cloud](https://github.com/openops-cloud/openops/blob/main/packages/openops/src/lib/google-cloud/auth.ts), [Zendesk](https://github.com/openops-cloud/openops/blob/main/packages/blocks/zendesk/src/index.ts), [Ternary](https://github.com/openops-cloud/openops/blob/main/packages/blocks/ternary/src/lib/common/auth.ts), [ServiceNow](https://github.com/openops-cloud/openops/blob/main/packages/blocks/servicenow/src/lib/auth.ts), [Kion](https://github.com/openops-cloud/openops/blob/main/packages/blocks/kion/src/lib/auth.ts), [Flexera One](https://github.com/openops-cloud/openops/blob/main/packages/blocks/flexera-one/src/lib/auth.ts), [Databricks](https://github.com/openops-cloud/openops/blob/main/packages/blocks/databricks/src/lib/common/auth.ts), and [CloudFix](https://github.com/openops-cloud/openops/blob/main/packages/blocks/cloudfix/src/lib/common/auth.ts).

Using the custom authentication type is demonstrated in [Contributing an Integration](/contributing/contributing-an-integration/), a guide that explains how to create a fully functional integration block.

```typescript
BlockAuth.CustomAuth({
authProviderKey: 'myservice',
authProviderDisplayName: 'My Service',
authProviderLogoUrl: 'https://static.openops.com/blocks/myservice.png',
description: 'Enter custom authentication details',
required: true,
props: {
baseUrl: Property.ShortText({
displayName: 'Base URL',
description: 'Enter the base URL',
required: true,
}),
accessToken: Property.SecretText({
displayName: 'Access Token',
description: 'Enter the access token',
required: true,
}),
},
// Optional validation
validate: async ({ auth }) => {
if (auth.baseUrl.endsWith('/')) {
return {
valid: false,
error: 'Base URL must not end with a slash',
};
} else {
return { valid: true };
}
},
})
```

The connection UI for this authentication type requests whatever inputs you defined in the `props` object:

![Connection UI - custom authentication](/images/contributing/connection-custom.png)

## OAuth2

This authentication type allows logging in with an OAuth2 provider either on behalf of a specific user (authorization code grant) or on behalf of a service (client credentials grant).

It's currently used by some OpenOps blocks, including [GitHub](https://github.com/openops-cloud/openops/blob/main/packages/blocks/github/src/lib/common/auth.ts), [Slack](https://github.com/openops-cloud/openops/blob/main/packages/blocks/slack/src/lib/common/authentication.ts), [Microsoft Teams](https://github.com/openops-cloud/openops/blob/main/packages/blocks/microsoft-teams/src/lib/common/microsoft-teams-auth.ts), and [Microsoft Outlook](https://github.com/openops-cloud/openops/blob/main/packages/blocks/microsoft-teams/src/lib/common/microsoft-teams-auth.ts).

```typescript
BlockAuth.OAuth2({
authProviderKey: 'bitbucket',
authProviderDisplayName: 'Bitbucket',
authProviderLogoUrl: `https://static.openops.com/blocks/bitbucket.png`,
description: '',
required: true,
scope: [
'account:write',
'repository:read',
'repository:write',
'pullrequest:write',
],
authUrl: 'https://bitbucket.org/site/oauth2/authorize',
tokenUrl: 'https://bitbucket.org/site/oauth2/access_token',
})
```

In the connection UI, the user can either click **Connect** to log in to the OAuth2 provider with their own credentials, or enter a client ID and client secret to authenticate a service.

![Connection UI - OAuth2 authentication](/images/contributing/connection-oauth2.png)

## No authentication

If your block doesn't require authentication, declare this explicitly by assigning `BlockAuth.None()` to the `auth` property.
Loading