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

# Authentication Guide

> Set up OAuth 2.0 access to the CRO API

Getting started with authentication is a 3-step process:

1. Set up your redirect URL.
2. Acquire credentials from CRO.
3. Verify credentials work.

The CRO API uses [OAuth 2.0](https://oauth.net/2/). It supports [Authorization Code](https://oauth.net/2/grant-types/authorization-code/) and [Refresh Token](https://oauth.net/2/grant-types/refresh-token/) grants and the [Authorization Code](https://oauth.net/2/grant-types/authorization-code/) and [PKCE](https://developer.okta.com/blog/2019/08/22/okta-authjs-pkce) flows.

At this time the Client Credentials grant (use of passwords) is not supported and will not be supported in the future.

## Redirect URL

The redirect URL (also called a **callback URL**) is the OAuth 2.0 endpoint **in your application** that we send the user's browser back to after they sign in. It arrives carrying the authorization code that your app exchanges for tokens — so it must be a route your code actually handles, not a general web page.

A company homepage or marketing page will not work: nothing there can receive or process the authorization code, and the sign-in flow will dead-end.

Typical values:

* A route in your app, e.g. `https://yourapp.example.com/oauth/callback`
* `http://localhost:3000/oauth/callback` during development
* The fixed callback URL published by the platform or OAuth library you're building on (e.g. Google Apps Script's `https://script.google.com/macros/d/{SCRIPT_ID}/usercallback`, Postman's `https://oauth.pstmn.io/v1/callback`)

You must provide this URL before we issue credentials, because we register it on your OAuth client — the flow only redirects to exactly-matching registered URLs. It can be changed any time after provisioning, and we can register more than one (e.g. development + production).

## Acquire Credentials from CRO

Once you have a redirect URL, contact our development team at [crodev@rapidworks.com](mailto:crodev@rapidworks.com?subject=CRO%20API%20Credentials%20Request) to have your credentials issued. Please keep the subject line as **"CRO API Credentials Request"** so we can route it quickly. See the FAQ for [what to include in your request](https://docs.crosoftware.com/guides/faq.md#what-information-do-i-need-to-provide-to-request-credentials) to avoid a round trip.

## Verify Credentials Work

With your account provisioned, now you're ready to make everything work. The easiest way to get started is to use an app like [Postman](https://www.getpostman.com/). Postman has built in support for OAuth testing, but any HTTP client tool should work.

## Request Access Token

Assuming you're using Postman, create a new request and click on the "Authentication" tab.

![Step 1: click on "Authorization" tab.](https://mintcdn.com/cro-software/rCZ6loEv_DN5uCRU/images/auth-guide/1_postman_select.png?fit=max\&auto=format\&n=rCZ6loEv_DN5uCRU\&q=85\&s=ff7e2d5bc46a72fe6c89ac621c8641f8)

Then click on "Request New Access Token".

![Step 2: click on "Request New Access Token".](https://mintcdn.com/cro-software/rCZ6loEv_DN5uCRU/images/auth-guide/2_postman_get_new_button.png?fit=max\&auto=format\&n=rCZ6loEv_DN5uCRU\&q=85\&s=73453696382c19e1e42efdf5d2c7f8a5)

Now fill out the dialog with the credentials and URLs given to you by the CRO development team. The "State" field must be at least 8 characters and may be whatever text you choose.

![Step 3: Fill out request dialog.](https://mintcdn.com/cro-software/rCZ6loEv_DN5uCRU/images/auth-guide/3_postman_token_dialog.png?fit=max\&auto=format\&n=rCZ6loEv_DN5uCRU\&q=85\&s=be54e589c6a5aa65ec722bd3ab9fb099)

Click "Request Token" and you will be redirected to a login page.

![Login page](https://mintcdn.com/cro-software/rCZ6loEv_DN5uCRU/images/auth-guide/4_login.png?fit=max\&auto=format\&n=rCZ6loEv_DN5uCRU\&q=85\&s=a52a578c0d5233b4a69ec0c49e151f6f)

Upon successful login, you will be presented with your new access token.

![New access token](https://mintcdn.com/cro-software/rCZ6loEv_DN5uCRU/images/auth-guide/5_token.png?fit=max\&auto=format\&n=rCZ6loEv_DN5uCRU\&q=85\&s=5d384dd6f179cc231eba8731477d99b6)

This token may now be used for accessing the CRO API. Include it as an [Authorization bearer header](https://tools.ietf.org/html/rfc6750) with requests requiring it (most).

## Conclusion

Congrats! Now you've got access to the CRO API. If you are still struggling with these steps, [reach out to us](https://www.crosoftware.com)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.