# RedbrickAuthenticator.AuthorizeApi

All URIs are relative to _http://localhost:8082/{version}_

| Method                                             | HTTP request               | Description |
| -------------------------------------------------- | -------------------------- | ----------- |
| [**adminToken**](AuthorizeApi.md#adminToken)       | **POST** /auth/token/admin |
| [**getAuthorize**](AuthorizeApi.md#getAuthorize)   | **GET** /auth/authorize    |
| [**postAuthorize**](AuthorizeApi.md#postAuthorize) | **POST** /auth/authorize   |
| [**token**](AuthorizeApi.md#token)                 | **POST** /auth/token       |
| [**tokenGen**](AuthorizeApi.md#tokenGen)           | **POST** /auth/token/gen   |
| [**validate**](AuthorizeApi.md#validate)           | **POST** /auth/validate    |

<a name="adminToken"></a>

# **adminToken**

> AccessAdminTokenResponse adminToken(opts)

### Example

```javascript
import {RedbrickAuthenticator} from "redbrick_authenticator";

let apiInstance = new RedbrickAuthenticator.AuthorizeApi();
let opts = {
  body: new RedbrickAuthenticator.AccessAdminTokenRequest(), // AccessAdminTokenRequest |
};
apiInstance.adminToken(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log("API called successfully. Returned data: " + data);
  }
});
```

### Parameters

| Name     | Type                                                      | Description | Notes      |
| -------- | --------------------------------------------------------- | ----------- | ---------- |
| **body** | [**AccessAdminTokenRequest**](AccessAdminTokenRequest.md) |             | [optional] |

### Return type

[**AccessAdminTokenResponse**](AccessAdminTokenResponse.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

<a name="getAuthorize"></a>

# **getAuthorize**

> AuthorizationCodeResponse getAuthorize(responseType, id, codeChallengeMethod, scope, state, opts)

The client constructs the request URI by adding the following parameters to the query component of the authorization endpoint URI using the \&quot;application/json\&quot; format

### Example

```javascript
import {RedbrickAuthenticator} from "redbrick_authenticator";

let apiInstance = new RedbrickAuthenticator.AuthorizeApi();
let responseType = "responseType_example"; // String | Indicates that your server expects to receive an authorization code
let id = "id_example"; // String | The application or client ID you received when you first created the application or client
let codeChallengeMethod = "codeChallengeMethod_example"; // String | either plain or HMAC, depending on whether the challenge is the plain verifier string or the HMAC256 hash of the string.
let scope = "scope_example"; // String | a space delimited list of scopes
let state = "state_example"; // String | a state string
let opts = {
  redirectUrl: "redirectUrl_example", // String | Indicates the URL to return the user to after authorization is complete, such as org.example.app://redirect with the client redirect URI. This parameter is optional, but if not send the user will be redirected to a pre-registered redirect URI.
  codeChallenge: "codeChallenge_example", // String | The code challenge generated as previously described
};
apiInstance.getAuthorize(
  responseType,
  id,
  codeChallengeMethod,
  scope,
  state,
  opts,
  (error, data, response) => {
    if (error) {
      console.error(error);
    } else {
      console.log("API called successfully. Returned data: " + data);
    }
  },
);
```

### Parameters

| Name                    | Type       | Description                                                                                                                                                                                                                                         | Notes      |
| ----------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| **responseType**        | **String** | Indicates that your server expects to receive an authorization code                                                                                                                                                                                 |
| **id**                  | **String** | The application or client ID you received when you first created the application or client                                                                                                                                                          |
| **codeChallengeMethod** | **String** | either plain or HMAC, depending on whether the challenge is the plain verifier string or the HMAC256 hash of the string.                                                                                                                            |
| **scope**               | **String** | a space delimited list of scopes                                                                                                                                                                                                                    |
| **state**               | **String** | a state string                                                                                                                                                                                                                                      |
| **redirectUrl**         | **String** | Indicates the URL to return the user to after authorization is complete, such as org.example.app://redirect with the client redirect URI. This parameter is optional, but if not send the user will be redirected to a pre-registered redirect URI. | [optional] |
| **codeChallenge**       | **String** | The code challenge generated as previously described                                                                                                                                                                                                | [optional] |

### Return type

[**AuthorizationCodeResponse**](AuthorizationCodeResponse.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

<a name="postAuthorize"></a>

# **postAuthorize**

> AuthorizationResponse postAuthorize(opts)

The client constructs the json format request body by adding the following parameters

### Example

```javascript
import {RedbrickAuthenticator} from "redbrick_authenticator";

let apiInstance = new RedbrickAuthenticator.AuthorizeApi();
let opts = {
  body: new RedbrickAuthenticator.AuthorizationRequest(), // AuthorizationRequest |
};
apiInstance.postAuthorize(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log("API called successfully. Returned data: " + data);
  }
});
```

### Parameters

| Name     | Type                                                | Description | Notes      |
| -------- | --------------------------------------------------- | ----------- | ---------- |
| **body** | [**AuthorizationRequest**](AuthorizationRequest.md) |             | [optional] |

### Return type

[**AuthorizationResponse**](AuthorizationResponse.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

<a name="token"></a>

# **token**

> AccessTokenResponse token(opts)

The client makes a request to the token endpoint by sending the following parameters using the \&quot;application/json\&quot; format per Appendix B with a character encoding of UTF-8 in the HTTP request entity-body:

### Example

```javascript
import {RedbrickAuthenticator} from "redbrick_authenticator";

let apiInstance = new RedbrickAuthenticator.AuthorizeApi();
let opts = {
  body: new RedbrickAuthenticator.AccessTokenRequest(), // AccessTokenRequest |
};
apiInstance.token(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log("API called successfully. Returned data: " + data);
  }
});
```

### Parameters

| Name     | Type                                            | Description | Notes      |
| -------- | ----------------------------------------------- | ----------- | ---------- |
| **body** | [**AccessTokenRequest**](AccessTokenRequest.md) |             | [optional] |

### Return type

[**AccessTokenResponse**](AccessTokenResponse.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

<a name="tokenGen"></a>

# **tokenGen**

> AccessTokenGenResponse tokenGen(opts)

### Example

```javascript
import {RedbrickAuthenticator} from "redbrick_authenticator";
let defaultClient = RedbrickAuthenticator.ApiClient.instance;

let apiInstance = new RedbrickAuthenticator.AuthorizeApi();
let opts = {
  body: new RedbrickAuthenticator.AccessTokenGenRequest(), // AccessTokenGenRequest |
};
apiInstance.tokenGen(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log("API called successfully. Returned data: " + data);
  }
});
```

### Parameters

| Name     | Type                                                  | Description | Notes      |
| -------- | ----------------------------------------------------- | ----------- | ---------- |
| **body** | [**AccessTokenGenRequest**](AccessTokenGenRequest.md) |             | [optional] |

### Return type

[**AccessTokenGenResponse**](AccessTokenGenResponse.md)

### Authorization

[BearerAuth](../README.md#BearerAuth)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

<a name="validate"></a>

# **validate**

> ValidateResponse validate(opts)

The in-house services and the 2nd/3rd party services can validate a token. If they have a privilege to access this endpoint.

### Example

```javascript
import {RedbrickAuthenticator} from "redbrick_authenticator";
let defaultClient = RedbrickAuthenticator.ApiClient.instance;

let apiInstance = new RedbrickAuthenticator.AuthorizeApi();
let opts = {
  body: new RedbrickAuthenticator.ValidateRequest(), // ValidateRequest |
};
apiInstance.validate(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log("API called successfully. Returned data: " + data);
  }
});
```

### Parameters

| Name     | Type                                      | Description | Notes      |
| -------- | ----------------------------------------- | ----------- | ---------- |
| **body** | [**ValidateRequest**](ValidateRequest.md) |             | [optional] |

### Return type

[**ValidateResponse**](ValidateResponse.md)

### Authorization

[BearerAuth](../README.md#BearerAuth)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json
