# FirstPartyAuthorizationChallenge (/docs/auth/api/type-aliases/FirstPartyAuthorizationChallenge)



[@kysoql/auth](/docs/auth/api) / FirstPartyAuthorizationChallenge

```ts
type FirstPartyAuthorizationChallenge =
  | {
  kind: "authorized";
  authorizationCode: string;
}
  | {
  kind: "challenge";
  status: number;
  error: string;
  errorCode?: string;
  authSession: string;
  response: Readonly<Record<string, unknown>>;
};
```

Result of a first-party Salesforce authorization challenge request.

## Union Members [#union-members]

### Type Literal [#type-literal]

```ts
{
  kind: "authorized";
  authorizationCode: string;
}
```

| Name                | Type           | Description                                               |
| ------------------- | -------------- | --------------------------------------------------------- |
| `kind`              | `"authorized"` | Indicates that Salesforce returned an authorization code. |
| `authorizationCode` | `string`       | Authorization code to exchange at the token endpoint.     |

***

### Type Literal [#type-literal-1]

```ts
{
  kind: "challenge";
  status: number;
  error: string;
  errorCode?: string;
  authSession: string;
  response: Readonly<Record<string, unknown>>;
}
```

| Name          | Type                                        | Description                                                    |
| ------------- | ------------------------------------------- | -------------------------------------------------------------- |
| `kind`        | `"challenge"`                               | Indicates that Salesforce requires another authorization step. |
| `status`      | `number`                                    | HTTP status returned for the challenge response.               |
| `error`       | `string`                                    | Salesforce OAuth error identifier for the challenge.           |
| `errorCode?`  | `string`                                    | More specific Salesforce error code, when supplied.            |
| `authSession` | `string`                                    | Session token to send when continuing the challenge flow.      |
| `response`    | `Readonly`\<`Record`\<`string`, `unknown`>> | Flow-specific response fields such as login\_status.           |
