> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackone.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Factorial OAuth 2.0 connector profile – StackOne setup guide

> Set up the OAuth 2.0 connector profile for Factorial in StackOne. One-time admin setup required before your users can link Factorial accounts via Hub.

<Warning>Admin privileges in your Factorial HR account are required to create OAuth applications.</Warning>

<section data-guide-section data-guide-scopes="">
  <h2>Creating an OAuth Application</h2>

  <p>To enable OAuth 2.0 authentication with StackOne, you need to create an OAuth application in Factorial.</p>

  <Steps>
    <Step title="Access the OAuth Applications Page">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Navigate to your OAuth applications page based on your environment.</p>

        <ul>
          <li>Production: <a href="https://api.factorialhr.com/oauth/applications" target="_blank" rel="noopener noreferrer">api.factorialhr.com/oauth/applications</a></li>
          <li>Sandbox: <a href="https://api.eu2.demo.factorial.dev/oauth/applications" target="_blank" rel="noopener noreferrer">api.eu2.demo.factorial.dev/oauth/applications</a></li>
        </ul>
      </div>
    </Step>

    <Step title="Create a New Application">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Click <strong>New Application</strong> to start the OAuth application creation process.</p>
      </div>
    </Step>

    <Step title="Configure Application Details">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Enter the required application details.</p>

        <ul>
          <li><strong>Name</strong>: Enter a descriptive name (e.g., `StackOne Integration`)</li>
          <li><strong>Redirect URI</strong>: `https://api.stackone.com/connect/oauth2/factorialhr/callback`</li>
          <li><strong>Confidential</strong>: Select based on your security requirements</li>
        </ul>
      </div>
    </Step>

    <Step title="Configure Scopes">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Select the OAuth scopes your application needs access to. Available scopes include employees, contracts, time\_off, recruitment, and more.</p>

        <ul>
          <li>Select only the scopes required for your integration</li>
          <li>See <a href="https://apidoc.factorialhr.com/docs/oauth-scopes" target="_blank" rel="noopener noreferrer">OAuth Scopes documentation</a> for full details</li>
        </ul>
      </div>
    </Step>

    <Step title="Save and Copy Credentials">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Click <strong>Submit</strong> to save the application. Your credentials will be displayed.</p>

        <ul>
          <li>Copy the <strong>Client ID</strong> and <strong>Client Secret</strong> and store them securely</li>
          <li>The Client Secret is only shown once at creation and cannot be retrieved later</li>
          <li>The Client ID can be found on the application details page anytime</li>
        </ul>
      </div>
    </Step>
  </Steps>
</section>

<section data-guide-section data-guide-scopes="">
  <h2>Token Types</h2>

  <p>Factorial supports two token types for OAuth authentication.</p>

  <Steps>
    <Step title="User Token">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>User tokens make requests on behalf of a specific user. The user must be an employee in Factorial with appropriate permissions.</p>

        <ul>
          <li>Expires in 1 hour</li>
          <li>Requires token refresh</li>
          <li>Actions are scoped to the user's permissions</li>
        </ul>
      </div>
    </Step>

    <Step title="Company Token">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Company tokens make requests on behalf of the company. Recommended for integrations that need company-wide access.</p>

        <ul>
          <li>Never expires (but can be revoked)</li>
          <li>No refresh needed</li>
          <li>Full company-level access</li>
        </ul>
      </div>
    </Step>
  </Steps>
</section>

## Creating the StackOne Connector Profile

To create the Connector Profile in StackOne for <strong>Factorial</strong>:

<Steps>
  <Step title="Navigate to Connector Profiles">
    Login to StackOne and navigate to [Connector Profiles](https://app.stackone.com/connector_profiles)
  </Step>

  <Step title="Create New Connector Profile">
    <ul>
      <li>Click <strong>+ Connector Profile</strong></li>
      <li>Search for and select <strong>Factorial</strong></li>
      <li>Select <strong>Type</strong> as <strong>OAuth 2.0</strong></li>

      <li>
        Fill out the fields using details retrieved from your provider:

        <ul style={{ marginLeft: '20px' }}>
          <li><strong>Client ID</strong></li>
          <li><strong>Client Secret</strong></li>
          <li><strong>OAuth Scopes</strong> (Optional)</li>
          <li><strong>Token Type</strong> (Optional)</li>
        </ul>
      </li>

      <li>(Optional) Select <strong>Actions</strong> to be enabled for this Connector Profile</li>
      <li>Click <strong>Create profile</strong></li>
    </ul>
  </Step>
</Steps>

Congratulations! The new Connector Profile will now show up in your project ready to be used. You can now continue to <a href="/guides/accounts-section#linking-accounts">Link Accounts</a> for <strong>Factorial</strong>.
