---
title: CIBA Authorize
description: The CIBA grant type uses its own authorize endpoint, POST /{{envID}}/as/cibaAuthorization, unlike other grant types. This endpoint returns an auth_req_id value that the relying party (RP) then passes to the token endpoint to obtain an access token and ID token.
component: pingone-api
page_id: pingone-api:auth:openid-connect-oauth-2/authorize-ciba
canonical_url: https://developer.pingidentity.com/pingone-api/auth/openid-connect-oauth-2/authorize-ciba.html
section_ids:
  prerequisites: Prerequisites
  headers: Headers
  body: Body
  example-request: Example Request
  example-response: Example Response
---

# CIBA Authorize

##

```none
POST {{authPath}}/{{envID}}/as/cibaAuthorization
```

The CIBA grant type uses its own authorize endpoint, `POST /{{envID}}/as/cibaAuthorization`, unlike other grant types. This endpoint returns an `auth_req_id` value that the relying party (RP) then passes to the token endpoint to obtain an access token and ID token.

The request must include a value for either `login_hint`, `id_token_hint`, or `login_hint_token`. Providing more than one of these properties will result in an error. Learn more in [Create a login\_hint\_token JWT](../auth-config-options/create-a-login_hint_token-jwt.html).

The application's configured `tokenEndpointAuthMethod` value determines how you authenticate. This must be either `CLIENT_SECRET_BASIC`, `CLIENT_SECRET_JWT`, `PRIVATE_KEY_JWT`, or `CLIENT_SECRET_POST`.

In the sample request shown here, the application's `tokenEndpointAuthMethod` value is `CLIENT_SECRET_BASIC`, which requires the `Authorization: Basic` HTTP header and a Base64-encoded representation of "username:password" in the request, in which the username is the `client_id` and the password is the `client_secret`.

If the application's `tokenEndpointAuthMethod` value is `CLIENT_SECRET_JWT`, the endpoint accepts a JWT signed by the application's client secret to authenticate the request. Learn more about creating the JWT and the claims in the JWT in [Create a client secret JWT](../auth-config-options/create-a-client-secret-jwt.html). This request requires the `client_assertion` and `client_assertion_type` properties to specify the JWT:

```
curl --location --request POST '{{authPath}}/{{envID}}/as/cibaAuthorization' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_assertion={{clientSecretJWT}}' \
--data-urlencode 'client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer' \
--data-urlencode 'login_hint={{cibaHint}}' \
--data-urlencode 'scope=openid'
```

If the application's `tokenEndpointAuthMethod` value is `PRIVATE_KEY_JWT`, the endpoint accepts a JWT signed by an external private key file to authenticate the request. Learn more about creating the JWT and the claims in the JWT in [Create a private key JWT](../auth-config-options/create-a-private-key-jwt.html). This request requires the `client_assertion` and `client_assertion_type` properties to specify the JWT:

```
curl --location --request POST '{{authPath}}/{{envID}}/as/cibaAuthorization' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_assertion={{privateKeyJWT}}' \
--data-urlencode 'client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer' \
--data-urlencode 'login_hint={{cibaHint}}' \
--data-urlencode 'scope=openid'
```

If the application's `tokenEndpointAuthMethod` value is `CLIENT_SECRET_POST`, the request does not require an Authorization header, and the `client_id` and `client_secret` properties are sent in the request body:

```
curl --location --request POST '{{authPath}}/{{envID}}/as/cibaAuthorization' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id={{appID}}' \
--data-urlencode 'client_secret={{appSecret}}'\
--data-urlencode 'login_hint={{cibaHint}}' \
--data-urlencode 'scope=openid'
```

### Prerequisites

* Refer to [OpenID Connect/OAuth 2](../openid-connect-oauth-2.html), [Authorization](authorize-intro.html), and [CIBA grant type](../../foundations/authentication-concepts/authorization-flow-by-grant-type/ciba-grant-type.html) for overview information.

* Refer to [Create a login\_hint\_token JWT](../auth-config-options/create-a-login_hint_token-jwt.html) for information about creating a `login_hint_token`.

> **Collapse: Request Model**
>
> | Property           | Type   | Required? |
> | ------------------ | ------ | --------- |
> | `login_hint`       | String | Optional  |
> | `id_token_hint`    | String | Optional  |
> | `login_hint_token` | String | Optional  |
> | `scope`            | String | Required  |
>
> Refer to the [OpenID Connect/OAuth2 data model](../openid-connect-oauth-2.html) for full property descriptions.

### Headers

Authorization

Content-Type      application/x-www-form-urlencoded

### Body

urlencoded ( application/x-www-form-urlencoded )

| Key         | Value        |
| ----------- | ------------ |
| login\_hint | {{cibaHint}} |
| scope       | {{scopeID}}  |

##

### Example Request

* cURL

* C#

* Go

* HTTP

* Java

* jQuery

* NodeJS

* Python

* PHP

* Ruby

* Swift

```shell
curl --location --globoff '{{authPath}}/{{envID}}/as/cibaAuthorization' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic e3thcHBJRH19Ont7YXBwU2VjcmV0fX0=' \
--data-urlencode 'login_hint={{cibaHint}}' \
--data-urlencode 'scope={{scopeID}}'
```

```csharp
var options = new RestClientOptions("{{authPath}}/{{envID}}/as/cibaAuthorization")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddHeader("Authorization", "Basic e3thcHBJRH19Ont7YXBwU2VjcmV0fX0=");
request.AddParameter("login_hint", "{{cibaHint}}");
request.AddParameter("scope", "{{scopeID}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
```

```golang
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io"
)

func main() {

  url := "{{authPath}}/{{envID}}/as/cibaAuthorization"
  method := "POST"

  payload := strings.NewReader("login_hint=%7B%7BcibaHint%7D%7D&scope=%7B%7BscopeID%7D%7D")

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
  req.Header.Add("Authorization", "Basic e3thcHBJRH19Ont7YXBwU2VjcmV0fX0=")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

```http
POST /{{envID}}/as/cibaAuthorization HTTP/1.1
Host: {{authPath}}
Content-Type: application/x-www-form-urlencoded
Authorization: Basic e3thcHBJRH19Ont7YXBwU2VjcmV0fX0=

login_hint=%7B%7BcibaHint%7D%7D&scope=%7B%7BscopeID%7D%7D
```

```java
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "login_hint={{cibaHint}}&scope={{scopeID}}");
Request request = new Request.Builder()
  .url("{{authPath}}/{{envID}}/as/cibaAuthorization")
  .method("POST", body)
  .addHeader("Content-Type", "application/x-www-form-urlencoded")
  .addHeader("Authorization", "Basic e3thcHBJRH19Ont7YXBwU2VjcmV0fX0=")
  .build();
Response response = client.newCall(request).execute();
```

```javascript
var settings = {
  "url": "{{authPath}}/{{envID}}/as/cibaAuthorization",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Content-Type": "application/x-www-form-urlencoded",
    "Authorization": "Basic e3thcHBJRH19Ont7YXBwU2VjcmV0fX0="
  },
  "data": {
    "login_hint": "{{cibaHint}}",
    "scope": "{{scopeID}}"
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
```

```javascript
var request = require('request');
var options = {
  'method': 'POST',
  'url': '{{authPath}}/{{envID}}/as/cibaAuthorization',
  'headers': {
    'Content-Type': 'application/x-www-form-urlencoded',
    'Authorization': 'Basic e3thcHBJRH19Ont7YXBwU2VjcmV0fX0='
  },
  form: {
    'login_hint': '{{cibaHint}}',
    'scope': '{{scopeID}}'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
```

```python
import requests

url = "{{authPath}}/{{envID}}/as/cibaAuthorization"

payload = 'login_hint=%7B%7BcibaHint%7D%7D&scope=%7B%7BscopeID%7D%7D'
headers = {
  'Content-Type': 'application/x-www-form-urlencoded',
  'Authorization': 'Basic e3thcHBJRH19Ont7YXBwU2VjcmV0fX0='
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
```

```php
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{authPath}}/{{envID}}/as/cibaAuthorization');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Content-Type' => 'application/x-www-form-urlencoded',
  'Authorization' => 'Basic e3thcHBJRH19Ont7YXBwU2VjcmV0fX0='
));
$request->addPostParameter(array(
  'login_hint' => '{{cibaHint}}',
  'scope' => '{{scopeID}}'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
```

```ruby
require "uri"
require "net/http"

url = URI("{{authPath}}/{{envID}}/as/cibaAuthorization")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/x-www-form-urlencoded"
request["Authorization"] = "Basic e3thcHBJRH19Ont7YXBwU2VjcmV0fX0="
request.body = "login_hint=%7B%7BcibaHint%7D%7D&scope=%7B%7BscopeID%7D%7D"

response = http.request(request)
puts response.read_body
```

```swift
let parameters = "login_hint=%7B%7BcibaHint%7D%7D&scope=%7B%7BscopeID%7D%7D"
let postData =  parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "{{authPath}}/{{envID}}/as/cibaAuthorization")!,timeoutInterval: Double.infinity)
request.addValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
request.addValue("Basic e3thcHBJRH19Ont7YXBwU2VjcmV0fX0=", forHTTPHeaderField: "Authorization")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in
  guard let data = data else {
    print(String(describing: error))
    return
  }
  print(String(data: data, encoding: .utf8)!)
}

task.resume()
```

### Example Response

200 OK

```json
{
  "auth_req_id": "1c266114-a1be-4700-8ad1-04986c5b9ac1",
  "expires_in": 120,
  "interval": 2
}
```
