public boolean authenticate(K8sAuthorisation authConfig) throws HyscaleException {
	    if (authConfig == null) {
	        return false;
	    }
		ApiClient apiClient = clientProvider.get(authConfig);
		AuthenticationV1Api apiInstance = new AuthenticationV1Api(apiClient);
		try {
			V1APIResourceList result = apiInstance.getAPIResources();
			return result != null;
		} catch (ApiException e) {
			logger.error("Exception when calling k8s authentication {} {} ", e.getCode(), e.getResponseBody(), e);
		    if (UNAUTHORISED_ERROR_CODE == e.getCode()) {
		        return false;
		    }
			throw new HyscaleException(e, CommonErrorCode.FAILED_TO_CONNECT_TO_CLUSTER,
					ExceptionHelper.getExceptionMessage(KUBERNETES_AUTHENTICATION, e, ResourceOperation.GET));
		}
	}
Kubernetes cluster authorisation handler
Checks if cluster access is allowed for given {@link AuthConfig}
deployer/deployer-services/src/main/java/io/hyscale/deployer/services/handler/impl/K8sAuthenticationHandler.java