# redbrick_authenticator

RedbrickAuthenticator - JavaScript client for redbrick_authenticator
The OAuth 2.0 authorization framework enables a third-party application to obtain limited access to an HTTP service, either on behalf of a resource owner by orchestrating an approval interaction between the resource owner and the HTTP service, or by allowing the third-party application to obtain access on its own behalf. This specification replaces and obsoletes the OAuth 1.0 protocol described in RFC 5849.
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:

- API version: 2.0.0-rc230214100516
- Package version: 2.0.0-rc230214100516
- Build package: io.swagger.codegen.v3.generators.javascript.JavaScriptClientCodegen

## Installation

### For [Node.js](https://nodejs.org/)

#### npm

To publish the library as a [npm](https://www.npmjs.com/),
please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).

Then install it via:

```shell
npm install redbrick_authenticator --save
```

#### git

#

If the library is hosted at a git repository, e.g.
https://github.com/GIT_USER_ID/GIT_REPO_ID
then install it via:

```shell
    npm install GIT_USER_ID/GIT_REPO_ID --save
```

### For browser

The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
the above steps with Node.js and installing browserify with `npm install -g browserify`,
perform the following (assuming _main.js_ is your entry file):

```shell
browserify main.js > bundle.js
```

Then include _bundle.js_ in the HTML pages.

### Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error:
Cannot resolve module", most certainly you should disable AMD loader. Add/merge
the following section to your webpack config:

```javascript
module: {
  rules: [
    {
      parser: {
        amd: false,
      },
    },
  ];
}
```

## Getting Started

Please follow the [installation](#installation) instruction and execute the following JS code:

```javascript
var RedbrickAuthenticator = require("redbrick_authenticator");

var api = new RedbrickAuthenticator.AuthorizeApi();
var opts = {
  body: new RedbrickAuthenticator.AccessAdminTokenRequest(), // {AccessAdminTokenRequest}
};
var callback = function (error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log("API called successfully. Returned data: " + data);
  }
};
api.adminToken(opts, callback);
```

## Documentation for API Endpoints

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

| Class                                | Method                                                       | HTTP request                | Description |
| ------------------------------------ | ------------------------------------------------------------ | --------------------------- | ----------- |
| _RedbrickAuthenticator.AuthorizeApi_ | [**adminToken**](docs/AuthorizeApi.md#adminToken)            | **POST** /auth/token/admin  |
| _RedbrickAuthenticator.AuthorizeApi_ | [**getAuthorize**](docs/AuthorizeApi.md#getAuthorize)        | **GET** /auth/authorize     |
| _RedbrickAuthenticator.AuthorizeApi_ | [**postAuthorize**](docs/AuthorizeApi.md#postAuthorize)      | **POST** /auth/authorize    |
| _RedbrickAuthenticator.AuthorizeApi_ | [**token**](docs/AuthorizeApi.md#token)                      | **POST** /auth/token        |
| _RedbrickAuthenticator.AuthorizeApi_ | [**tokenGen**](docs/AuthorizeApi.md#tokenGen)                | **POST** /auth/token/gen    |
| _RedbrickAuthenticator.AuthorizeApi_ | [**validate**](docs/AuthorizeApi.md#validate)                | **POST** /auth/validate     |
| _RedbrickAuthenticator.ClientApi_    | [**getIpxToken**](docs/ClientApi.md#getIpxToken)             | **POST** /auth/token/ipx    |
| _RedbrickAuthenticator.ClientApi_    | [**getKbToken**](docs/ClientApi.md#getKbToken)               | **POST** /auth/token/kb     |
| _RedbrickAuthenticator.ServiceApi_   | [**liveness**](docs/ServiceApi.md#liveness)                  | **GET** /liveness           |
| _RedbrickAuthenticator.ServiceApi_   | [**ready**](docs/ServiceApi.md#ready)                        | **GET** /ready              |
| _RedbrickAuthenticator.WalletApi_    | [**createWalletToken**](docs/WalletApi.md#createWalletToken) | **POST** /auth/wallet/token |
| _RedbrickAuthenticator.WalletApi_    | [**getNonce**](docs/WalletApi.md#getNonce)                   | **POST** /auth/nonce        |
| _RedbrickAuthenticator.WalletApi_    | [**linkWallet**](docs/WalletApi.md#linkWallet)               | **POST** /auth/wallet/link  |

## Documentation for Models

- [RedbrickAuthenticator.AccessAdminTokenRequest](docs/AccessAdminTokenRequest.md)
- [RedbrickAuthenticator.AccessAdminTokenResponse](docs/AccessAdminTokenResponse.md)
- [RedbrickAuthenticator.AccessTokenGenRequest](docs/AccessTokenGenRequest.md)
- [RedbrickAuthenticator.AccessTokenGenResponse](docs/AccessTokenGenResponse.md)
- [RedbrickAuthenticator.AccessTokenRequest](docs/AccessTokenRequest.md)
- [RedbrickAuthenticator.AccessTokenResponse](docs/AccessTokenResponse.md)
- [RedbrickAuthenticator.AuthorizationClientResponse](docs/AuthorizationClientResponse.md)
- [RedbrickAuthenticator.AuthorizationCode](docs/AuthorizationCode.md)
- [RedbrickAuthenticator.AuthorizationCodeResponse](docs/AuthorizationCodeResponse.md)
- [RedbrickAuthenticator.AuthorizationRequest](docs/AuthorizationRequest.md)
- [RedbrickAuthenticator.AuthorizationResponse](docs/AuthorizationResponse.md)
- [RedbrickAuthenticator.ClientCredentials](docs/ClientCredentials.md)
- [RedbrickAuthenticator.ClientUserToken](docs/ClientUserToken.md)
- [RedbrickAuthenticator.CombinedCredentials](docs/CombinedCredentials.md)
- [RedbrickAuthenticator.CreateWalletTokenRequest](docs/CreateWalletTokenRequest.md)
- [RedbrickAuthenticator.CreateWalletTokenResponse](docs/CreateWalletTokenResponse.md)
- [RedbrickAuthenticator.DeviceCode](docs/DeviceCode.md)
- [RedbrickAuthenticator.GetIpxTokenRequest](docs/GetIpxTokenRequest.md)
- [RedbrickAuthenticator.GetKbTokenRequest](docs/GetKbTokenRequest.md)
- [RedbrickAuthenticator.GetKbTokenResponse](docs/GetKbTokenResponse.md)
- [RedbrickAuthenticator.GetNonceRequest](docs/GetNonceRequest.md)
- [RedbrickAuthenticator.GetSocialTokenResponse](docs/GetSocialTokenResponse.md)
- [RedbrickAuthenticator.LinkWalletRequest](docs/LinkWalletRequest.md)
- [RedbrickAuthenticator.NonceResponse](docs/NonceResponse.md)
- [RedbrickAuthenticator.OneOfaccessTokenRequestRequest](docs/OneOfaccessTokenRequestRequest.md)
- [RedbrickAuthenticator.OneOfauthorizationResponseResponse](docs/OneOfauthorizationResponseResponse.md)
- [RedbrickAuthenticator.RefreshToken](docs/RefreshToken.md)
- [RedbrickAuthenticator.ResponseMessage](docs/ResponseMessage.md)
- [RedbrickAuthenticator.UserToken](docs/UserToken.md)
- [RedbrickAuthenticator.ValidateRequest](docs/ValidateRequest.md)
- [RedbrickAuthenticator.ValidateResponse](docs/ValidateResponse.md)
- [RedbrickAuthenticator.WalletResponse](docs/WalletResponse.md)
- [RedbrickAuthenticator.WorldInfo](docs/WorldInfo.md)

## Documentation for Authorization

### ApiKeyAuth

- **Type**: API key
- **API key parameter name**: X-API-Key
- **Location**: HTTP header

### BasicAuth

- **Type**: HTTP basic authentication

### BearerAuth

### OAuth2AuthorizationCode

- **Type**: OAuth
- **Flow**: accessCode
- **Authorization URL**: https://auth.redbrick.land/v2/authorize
- **Scopes**:
  - :

### OAuth2Client

- **Type**: OAuth
- **Flow**: application
- **Authorization URL**:
- **Scopes**:
  - :

### OAuth2Password

- **Type**: OAuth
- **Flow**: password
- **Authorization URL**:
- **Scopes**:
  - :
