Skip to content
Ona Docs

CheckAuthenticationForHost

runners.check_authentication_for_host(RunnerCheckAuthenticationForHostParams**kwargs) -> RunnerCheckAuthenticationForHostResponse
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
host: Optional[str]
runner_id: Optional[str]
formatuuid
ReturnsExpand Collapse
class RunnerCheckAuthenticationForHostResponse:
authenticated: Optional[bool]
Deprecatedauthentication_url: Optional[str]
Deprecatedpat_supported: Optional[bool]
scm_id: Optional[str]

scm_id is the unique identifier of the SCM provider

scm_name: Optional[str]

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

supports_oauth2: Optional[SupportsOauth2]

supports_oauth2 indicates that the host supports OAuth2 authentication

auth_url: Optional[str]

auth_url is the URL where users can authenticate

docs_url: Optional[str]

docs_url is the URL to the documentation explaining this authentication method

supports_pat: Optional[SupportsPat]

supports_pat indicates that the host supports Personal Access Token authentication

create_url: Optional[str]

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

docs_url: Optional[str]

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

example: Optional[str]

example is an example of a Personal Access Token

required_scopes: Optional[List[str]]

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

CheckAuthenticationForHost

import os
from gitpod import Gitpod

client = Gitpod(
    bearer_token=os.environ.get("GITPOD_API_KEY"),  # This is the default and can be omitted
)
response = client.runners.check_authentication_for_host(
    host="github.com",
)
print(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"
    ]
  }
}