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"
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"
]
}
}