## CheckAuthenticationForHost `client.Runners.CheckAuthenticationForHost(ctx, body) (*RunnerCheckAuthenticationForHostResponse, error)` **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. ```yaml host: "github.com" ``` ### Parameters - `body RunnerCheckAuthenticationForHostParams` - `Host param.Field[string]` - `RunnerID param.Field[string]` ### Returns - `type RunnerCheckAuthenticationForHostResponse struct{…}` - `Authenticated bool` - `AuthenticationURL string` - `PatSupported bool` - `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 RunnerCheckAuthenticationForHostResponseSupportsOauth2` 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 RunnerCheckAuthenticationForHostResponseSupportsPat` 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 []string` required_scopes is the list of permissions required for the Personal Access Token ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) response, err := client.Runners.CheckAuthenticationForHost(context.TODO(), gitpod.RunnerCheckAuthenticationForHostParams{ Host: gitpod.F("github.com"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Authenticated) } ``` #### Response ```json { "authenticated": true, "authenticationUrl": "authenticationUrl", "patSupported": true, "scmId": "scmId", "scmName": "scmName", "supportsOauth2": { "authUrl": "authUrl", "docsUrl": "docsUrl" }, "supportsPat": { "createUrl": "createUrl", "docsUrl": "docsUrl", "example": "example", "requiredScopes": [ "string" ] } } ```