---
name: bamboohr-install-auth
description: >-
  Choose and configure BambooHR OAuth 2.0 or API-key authentication without leaking HR credentials. Use when registering a partner integration, wiring token refresh, or repairing tenant authentication. Trigger with "BambooHR auth", "BambooHR OAuth", "BambooHR API key", or "BambooHR token refresh".
allowed-tools: Read,Glob,Grep,Write,Edit
argument-hint: "<oauth|api-key> <tenant-subdomain>"
version: 1.5.0
license: MIT
author: Jeremy Longshore <jeremy@intentsolutions.io>
tags: [ saas, hr, bamboohr, authentication, oauth ]
model: inherit
effort: high
compatibility: Designed for Claude Code
title: bamboohr-install-auth
canonical_url: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/bamboohr-install-auth
last_updated: 2026-10-07T06:06:28.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [references/official-docs.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/bamboohr-install-auth/references/official-docs.md).
>
> If the user asked to install this Skill, run `npx skilld install jeremylongshore/tons-of-skills-marketplace/bamboohr-install-auth`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/bamboohr-install-auth`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/jeremylongshore/tons-of-skills-marketplace/bamboohr-install-auth) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/bamboohr-install-auth`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/bamboohr-install-auth --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/bamboohr-install-auth --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# BambooHR Authentication Setup

## Overview

Configure the narrowest BambooHR identity that fits the integration. OAuth 2.0
is BambooHR's recommended path for partner integrations. An API key is suitable
for an internal tool or prototype when its owning user's permissions and key
lifecycle are acceptable.

## Prerequisites

- The target repository or integration path and the requested operator outcome.
- The tenant, identity, and data scope only when approved live work is in scope.
- The current evidence register plus customer-specific permissions and agreements.

## Current Contract

- Tenant API host: `https://{company-subdomain}.bamboohr.com`.
- Authorization endpoint: `https://{company-subdomain}.bamboohr.com/authorize.php`.
- Token endpoint: `POST https://{company-subdomain}.bamboohr.com/token.php?request=token`.
- API-key requests use HTTP Basic authentication with the key as username and
  `x` as password.
- BambooHR's official Python source supports OAuth, refresh, API keys, request
  IDs, retry controls, and redacted logging. As of 2026-09-11 the documented
  `bamboohr-sdk` distribution is not discoverable on public PyPI; verify the
  registry before installing or use an approved commit pin.

## Authentication

For OAuth, register an HTTPS redirect URI, generate a high-entropy `state`, bind
it to the initiating session, and reject callbacks whose state does not match.
Exchange the code server-side. Store access token, refresh token, expiry, tenant,
subject, and granted scope in an encrypted, tenant-scoped record.

For API keys, create a dedicated BambooHR user with only required field and
workflow permissions. Store the key in the deployment secret manager. Never put
it in `.env.example`, logs, shell history, test fixtures, or a client bundle.

## Instructions

1. Identify whether the integration is partner/multi-tenant or internal/single-
   tenant, and record the authentication decision.
2. Derive the tenant subdomain from the customer's BambooHR URL; do not accept a
   full arbitrary host from untrusted input.
3. For OAuth, implement authorization-code exchange, state validation, encrypted
   token persistence, rotation, and reauthorization after terminal refresh
   failure. The SDK does not persist refreshed tokens for the application.
4. For API keys, assign a dedicated owner, document field permissions, and set a
   rotation and revocation procedure before use.
5. Test with a low-sensitivity read such as company information. Capture status
   and request ID, but discard the response body from evidence.
6. Exercise invalid-state, expired-token, revoked-key, wrong-tenant, and denied-
   field cases before production approval.

## Tool Discipline

Use Read, Glob, and Grep to inspect existing configuration and secret references.
Use Write or Edit only for approved application configuration; write placeholders,
never credentials. This skill does not authorize browser consent, credential
creation, package installation, or remote secret mutation.

## Approval Boundaries

Require explicit approval before registering an OAuth app, changing redirect
URIs, creating or rotating an API key, writing a deployment secret, or testing
against a production tenant.

## Output

Return the chosen auth mode, tenant, requested permissions, callback and token-
storage design, test evidence without bodies, key/token owner, rotation plan,
and every action still awaiting approval.

## Error Handling

- OAuth callback state mismatch: reject immediately and start a fresh flow.
- `401`: refresh once when configured; otherwise treat the credential as invalid.
- `403`: inspect the BambooHR user's field permissions; do not broaden blindly.
- Refresh failure: stop bounded retries, preserve the last valid record, and
  require reauthorization.

## Examples

- "Configure OAuth for our multi-tenant HR connector" selects OAuth and designs
  tenant-isolated token persistence.
- "Use this admin's API key in production" pauses until a dedicated least-
  privilege identity and rotation owner exist.

## Resources

Read [official evidence](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/bamboohr-install-auth/references/official-docs.md) before implementation.
