# rainbow_authentication_portal

RainbowAuthenticationPortal - JavaScript client for rainbow_authentication_portal
# Rainbow authentication portal API guide  ## Preamble  [Download Postman collection][0]  ### Introduction  This guide describes list of API services that are provided by OT Rainbow authentication portal system. Services are used to manage OT Rainbow authentication.  ### Protocol  REST interface is used for sending/receiving OT rainbow API messages.   HTTP request GET is used. Standard HTTP responses are used to provide requested information or error status. There is no session notion in OT Rainbow system, so requests could be issued according stateless model, without transport conservation between them.   JSON is used as a main format for data encoding in message body part. Each request is started with the following pattern /{module}/{version}/ where {module} is a portal module name to address and {version} is a version of used API, par example, “v1.0”.  ### Security considerations  Each request should contain some credential information to authenticate itself. Standard HTTP authentication with basic/bearer modes is used. JSON Web Token mechanism is used to provide authentication information. JWT has a expire timeout that is controlled by OT Rainbow portal to prevent very long token usage. Also authentication with application token is used. The token must be provided in the request HTTP header, using a custom header: APIKey. At server side, token is verified, and if it doesn’t match, 403 Not Allowed response is sent. TLS is used as a transport protocol to support message exchanges between OT Rainbow portal and an application.    [0]: AuthenticationPortalServer_postman.json
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 1.104.0
- Package version: 1.104.0
- Build package: org.openapitools.codegen.languages.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 rainbow_authentication_portal --save
```

##### Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing 
into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run:

```shell
npm install
```

Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`:

```shell
npm link
```

Finally, switch to the directory you want to use your rainbow_authentication_portal from, and run:

```shell
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
```

You should now be able to `require('rainbow_authentication_portal')` in javascript files from the directory you ran the last 
command above from.

#### 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, that's to say your javascript file where you actually 
use this library):

```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 RainbowAuthenticationPortal = require('rainbow_authentication_portal');

var defaultClient = RainbowAuthenticationPortal.ApiClient.instance;
// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix['Authorization'] = "Token"

var api = new RainbowAuthenticationPortal.AuthenticationApi()
var accept = "accept_example"; // {String} application/json
api.getApiRainbowAuthenticationV10Validator(accept).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});


```

## Documentation for API Endpoints

All URIs are relative to *http://localhost*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*RainbowAuthenticationPortal.AuthenticationApi* | [**getApiRainbowAuthenticationV10Validator**](docs/AuthenticationApi.md#getApiRainbowAuthenticationV10Validator) | **GET** /api/rainbow/authentication/v1.0/validator | Validate user JWT
*RainbowAuthenticationPortal.AuthenticationApi* | [**getBasicLogin**](docs/AuthenticationApi.md#getBasicLogin) | **GET** /api/rainbow/authentication/v1.0/login | Login user
*RainbowAuthenticationPortal.AuthenticationApi* | [**getLogout**](docs/AuthenticationApi.md#getLogout) | **GET** /api/rainbow/authentication/v1.0/logout | Logout user
*RainbowAuthenticationPortal.AuthenticationApi* | [**getRenew**](docs/AuthenticationApi.md#getRenew) | **GET** /api/rainbow/authentication/v1.0/renew | Renew user JWT
*RainbowAuthenticationPortal.AuthenticationUrlsApi* | [**getLoginUrl**](docs/AuthenticationUrlsApi.md#getLoginUrl) | **GET** /api/rainbow/authentication/v1.0/urls | Get user authentication URLs
*RainbowAuthenticationPortal.CommonApi* | [**deleteMetrics**](docs/CommonApi.md#deleteMetrics) | **DELETE** /api/rainbow/metrics | Clear performance metrics
*RainbowAuthenticationPortal.CommonApi* | [**getApiRainbowAuthenticationV10About**](docs/CommonApi.md#getApiRainbowAuthenticationV10About) | **GET** /api/rainbow/authentication/v1.0/about | About authentication portal
*RainbowAuthenticationPortal.CommonApi* | [**getApiRainbowPing**](docs/CommonApi.md#getApiRainbowPing) | **GET** /api/rainbow/ping | Get authentication portal status report
*RainbowAuthenticationPortal.CommonApi* | [**getMetrics**](docs/CommonApi.md#getMetrics) | **GET** /api/rainbow/metrics | Get performance metrics
*RainbowAuthenticationPortal.CommonApi* | [**putApiRainbowLogsLevels**](docs/CommonApi.md#putApiRainbowLogsLevels) | **PUT** /api/rainbow/logs/levels | Change log level
*RainbowAuthenticationPortal.OauthAuthenticationApi* | [**oAuthAuthorize**](docs/OauthAuthenticationApi.md#oAuthAuthorize) | **GET** /api/rainbow/authentication/v1.0/oauth/authorize | 1 - OAuth Authorization Request
*RainbowAuthenticationPortal.OauthAuthenticationApi* | [**oAuthToken**](docs/OauthAuthenticationApi.md#oAuthToken) | **POST** /api/rainbow/authentication/v1.0/oauth/token | 2 - OAuth Access Token Request
*RainbowAuthenticationPortal.OauthTokensApi* | [**deleteOAuthToken**](docs/OauthTokensApi.md#deleteOAuthToken) | **DELETE** /api/rainbow/authentication/v1.0/oauth/tokens/{tokenId} | Delete an OAuth token
*RainbowAuthenticationPortal.OauthTokensApi* | [**getOAuthToken**](docs/OauthTokensApi.md#getOAuthToken) | **GET** /api/rainbow/authentication/v1.0/oauth/tokens | Get all OAuth token
*RainbowAuthenticationPortal.OauthTokensApi* | [**getOAuthTokenById**](docs/OauthTokensApi.md#getOAuthTokenById) | **GET** /api/rainbow/authentication/v1.0/oauth/tokens/{tokenId} | Get an OAuth token
*RainbowAuthenticationPortal.OidcClientApi* | [**getJwt**](docs/OidcClientApi.md#getJwt) | **GET** /api/rainbow/authentication/v1.0/oidc-client/jwt | Get a JWT from an id_token
*RainbowAuthenticationPortal.OidcClientApi* | [**getOidcLogin**](docs/OidcClientApi.md#getOidcLogin) | **GET** /api/rainbow/authentication/v1.0/oidc-client/login | Initiate an OIDC authentication
*RainbowAuthenticationPortal.SamlAuthenticationApi* | [**getSamlAssertion**](docs/SamlAuthenticationApi.md#getSamlAssertion) | **GET** /api/rainbow/authentication/v1.0/saml/{companyId}/assert | IDP logout response
*RainbowAuthenticationPortal.SamlAuthenticationApi* | [**getSamlAssertionConfiguration**](docs/SamlAuthenticationApi.md#getSamlAssertionConfiguration) | **GET** /api/rainbow/authentication/v1.0/saml/{companyId}/metadata.xml | Get assertion configuration for a company
*RainbowAuthenticationPortal.SamlAuthenticationApi* | [**getSamlLogin**](docs/SamlAuthenticationApi.md#getSamlLogin) | **GET** /api/rainbow/authentication/v1.0/saml/login | Initiate an SAML authentication
*RainbowAuthenticationPortal.SamlAuthenticationApi* | [**getSamlLogout**](docs/SamlAuthenticationApi.md#getSamlLogout) | **GET** /api/rainbow/authentication/v1.0/saml/logout | Close SAML session
*RainbowAuthenticationPortal.SamlAuthenticationApi* | [**postSamlAssertion**](docs/SamlAuthenticationApi.md#postSamlAssertion) | **POST** /api/rainbow/authentication/v1.0/saml/{companyId}/assert | IDP authentication response


## Documentation for Models

 - [RainbowAuthenticationPortal.DeleteMetricsSuccess](docs/DeleteMetricsSuccess.md)
 - [RainbowAuthenticationPortal.DeleteOAuthTokenSuccess](docs/DeleteOAuthTokenSuccess.md)
 - [RainbowAuthenticationPortal.DeleteOAuthTokenSuccessData](docs/DeleteOAuthTokenSuccessData.md)
 - [RainbowAuthenticationPortal.GetApiRainbowAuthenticationV10AboutSuccess](docs/GetApiRainbowAuthenticationV10AboutSuccess.md)
 - [RainbowAuthenticationPortal.GetApiRainbowAuthenticationV10ValidatorSuccess](docs/GetApiRainbowAuthenticationV10ValidatorSuccess.md)
 - [RainbowAuthenticationPortal.GetApiRainbowPingSuccess](docs/GetApiRainbowPingSuccess.md)
 - [RainbowAuthenticationPortal.GetBasicLoginSuccess](docs/GetBasicLoginSuccess.md)
 - [RainbowAuthenticationPortal.GetBasicLoginSuccessEmails](docs/GetBasicLoginSuccessEmails.md)
 - [RainbowAuthenticationPortal.GetBasicLoginSuccessLoggedInApplication](docs/GetBasicLoginSuccessLoggedInApplication.md)
 - [RainbowAuthenticationPortal.GetBasicLoginSuccessLoggedInUser](docs/GetBasicLoginSuccessLoggedInUser.md)
 - [RainbowAuthenticationPortal.GetBasicLoginSuccessLoggedInUserCreatedByAdmin](docs/GetBasicLoginSuccessLoggedInUserCreatedByAdmin.md)
 - [RainbowAuthenticationPortal.GetBasicLoginSuccessPhoneNumbers](docs/GetBasicLoginSuccessPhoneNumbers.md)
 - [RainbowAuthenticationPortal.GetBasicLoginSuccessProfiles](docs/GetBasicLoginSuccessProfiles.md)
 - [RainbowAuthenticationPortal.GetBasicLoginSuccessProvisioningNeeded](docs/GetBasicLoginSuccessProvisioningNeeded.md)
 - [RainbowAuthenticationPortal.GetJwtSuccess](docs/GetJwtSuccess.md)
 - [RainbowAuthenticationPortal.GetJwtSuccessEmails](docs/GetJwtSuccessEmails.md)
 - [RainbowAuthenticationPortal.GetJwtSuccessLoggedInUser](docs/GetJwtSuccessLoggedInUser.md)
 - [RainbowAuthenticationPortal.GetJwtSuccessPhoneNumbers](docs/GetJwtSuccessPhoneNumbers.md)
 - [RainbowAuthenticationPortal.GetJwtSuccessProfiles](docs/GetJwtSuccessProfiles.md)
 - [RainbowAuthenticationPortal.GetJwtSuccessProvisioningNeeded](docs/GetJwtSuccessProvisioningNeeded.md)
 - [RainbowAuthenticationPortal.GetLoginUrlSuccess](docs/GetLoginUrlSuccess.md)
 - [RainbowAuthenticationPortal.GetLoginUrlSuccessData](docs/GetLoginUrlSuccessData.md)
 - [RainbowAuthenticationPortal.GetLogoutSuccess](docs/GetLogoutSuccess.md)
 - [RainbowAuthenticationPortal.GetMetricsSuccess](docs/GetMetricsSuccess.md)
 - [RainbowAuthenticationPortal.GetOAuthTokenByIdSuccess](docs/GetOAuthTokenByIdSuccess.md)
 - [RainbowAuthenticationPortal.GetOAuthTokenSuccess](docs/GetOAuthTokenSuccess.md)
 - [RainbowAuthenticationPortal.GetOidcLoginSuccess](docs/GetOidcLoginSuccess.md)
 - [RainbowAuthenticationPortal.GetRenewSuccess](docs/GetRenewSuccess.md)
 - [RainbowAuthenticationPortal.GetRenewSuccessEmails](docs/GetRenewSuccessEmails.md)
 - [RainbowAuthenticationPortal.GetRenewSuccessLoggedInUser](docs/GetRenewSuccessLoggedInUser.md)
 - [RainbowAuthenticationPortal.GetRenewSuccessPhoneNumbers](docs/GetRenewSuccessPhoneNumbers.md)
 - [RainbowAuthenticationPortal.GetRenewSuccessProfiles](docs/GetRenewSuccessProfiles.md)
 - [RainbowAuthenticationPortal.GetRenewSuccessProvisioningNeeded](docs/GetRenewSuccessProvisioningNeeded.md)
 - [RainbowAuthenticationPortal.GetSamlAssertionConfigurationSuccess](docs/GetSamlAssertionConfigurationSuccess.md)
 - [RainbowAuthenticationPortal.GetSamlAssertionSuccess](docs/GetSamlAssertionSuccess.md)
 - [RainbowAuthenticationPortal.GetSamlLoginSuccess](docs/GetSamlLoginSuccess.md)
 - [RainbowAuthenticationPortal.GetSamlLogoutSuccess](docs/GetSamlLogoutSuccess.md)
 - [RainbowAuthenticationPortal.OAuthAuthorizeSuccess](docs/OAuthAuthorizeSuccess.md)
 - [RainbowAuthenticationPortal.OAuthToken](docs/OAuthToken.md)
 - [RainbowAuthenticationPortal.OAuthTokenSuccess](docs/OAuthTokenSuccess.md)
 - [RainbowAuthenticationPortal.PostSamlAssertion](docs/PostSamlAssertion.md)
 - [RainbowAuthenticationPortal.PostSamlAssertionSuccess](docs/PostSamlAssertionSuccess.md)
 - [RainbowAuthenticationPortal.PostSamlAssertionSuccessEmails](docs/PostSamlAssertionSuccessEmails.md)
 - [RainbowAuthenticationPortal.PostSamlAssertionSuccessLoggedInUser](docs/PostSamlAssertionSuccessLoggedInUser.md)
 - [RainbowAuthenticationPortal.PostSamlAssertionSuccessPhoneNumbers](docs/PostSamlAssertionSuccessPhoneNumbers.md)
 - [RainbowAuthenticationPortal.PostSamlAssertionSuccessProfiles](docs/PostSamlAssertionSuccessProfiles.md)
 - [RainbowAuthenticationPortal.PostSamlAssertionSuccessProvisioningNeeded](docs/PostSamlAssertionSuccessProvisioningNeeded.md)
 - [RainbowAuthenticationPortal.PutApiRainbowLogsLevels](docs/PutApiRainbowLogsLevels.md)
 - [RainbowAuthenticationPortal.PutApiRainbowLogsLevelsSuccess](docs/PutApiRainbowLogsLevelsSuccess.md)
 - [RainbowAuthenticationPortal.PutApiRainbowLogsLevelsSuccessNewLoggerLevels](docs/PutApiRainbowLogsLevelsSuccessNewLoggerLevels.md)
 - [RainbowAuthenticationPortal.PutApiRainbowLogsLevelsSuccessOldLoggerLevels](docs/PutApiRainbowLogsLevelsSuccessOldLoggerLevels.md)


## Documentation for Authorization


### Basic

- **Type**: HTTP basic authentication


### Bearer

- **Type**: API key
- **API key parameter name**: Authorization
- **Location**: HTTP header

