Skip to content
Ona Docs

CheckAuthenticationForHost

client.runners.checkAuthenticationForHost(RunnerCheckAuthenticationForHostParams { host, runnerId } body, RequestOptionsoptions?): RunnerCheckAuthenticationForHostResponse { authenticated, authenticationUrl, patSupported, 4 more }
POST/gitpod.v1.RunnerService/CheckAuthenticationForHost

Checks if a user is authenticated for a specific host.

Use this method to:

  • Verify authentication status
  • Get authentication URLs
  • Check PAT support

Examples

  • Check authentication:

    Verifies authentication for a host.

    host: "github.com"
ParametersExpand Collapse
body: RunnerCheckAuthenticationForHostParams { host, runnerId }
host?: string
runnerId?: string
formatuuid
ReturnsExpand Collapse
RunnerCheckAuthenticationForHostResponse { authenticated, authenticationUrl, patSupported, 4 more }
authenticated?: boolean
DeprecatedauthenticationUrl?: string
DeprecatedpatSupported?: boolean
scmId?: string

scm_id is the unique identifier of the SCM provider

scmName?: string

scm_name is the human-readable name of the SCM provider (e.g., “GitHub”, “GitLab”)

supportsOauth2?: SupportsOauth2 { authUrl, docsUrl }

supports_oauth2 indicates that the host supports OAuth2 authentication

authUrl?: string

auth_url is the URL where users can authenticate

docsUrl?: string

docs_url is the URL to the documentation explaining this authentication method

supportsPat?: SupportsPat { createUrl, docsUrl, example, requiredScopes }

supports_pat indicates that the host supports Personal Access Token authentication

createUrl?: string

create_url is the URL where users can create a new Personal Access Token

docsUrl?: string

docs_url is the URL to the documentation explaining PAT usage for this host

example?: string

example is an example of a Personal Access Token

requiredScopes?: Array<string>

required_scopes is the list of permissions required for the Personal Access Token

CheckAuthenticationForHost

import Gitpod from '@gitpod/sdk';

const client = new Gitpod({
  bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted
});

const response = await client.runners.checkAuthenticationForHost({ host: 'github.com' });

console.log(response.authenticated);
{
  "authenticated": true,
  "authenticationUrl": "authenticationUrl",
  "patSupported": true,
  "scmId": "scmId",
  "scmName": "scmName",
  "supportsOauth2": {
    "authUrl": "authUrl",
    "docsUrl": "docsUrl"
  },
  "supportsPat": {
    "createUrl": "createUrl",
    "docsUrl": "docsUrl",
    "example": "example",
    "requiredScopes": [
      "string"
    ]
  }
}
Returns Examples
{
  "authenticated": true,
  "authenticationUrl": "authenticationUrl",
  "patSupported": true,
  "scmId": "scmId",
  "scmName": "scmName",
  "supportsOauth2": {
    "authUrl": "authUrl",
    "docsUrl": "docsUrl"
  },
  "supportsPat": {
    "createUrl": "createUrl",
    "docsUrl": "docsUrl",
    "example": "example",
    "requiredScopes": [
      "string"
    ]
  }
}