# Cyclos411Api.AuthApi

All URIs are relative to *https://138.197.145.149:8080/cyclos/eCloudAtm/api*

Method | HTTP request | Description
------------- | ------------- | -------------
[**changeForgottenPassword**](AuthApi.md#changeForgottenPassword) | **POST** /auth/forgotten-password | Changes the a forgotten password after have completed the request 
[**disconnectCurrentClient**](AuthApi.md#disconnectCurrentClient) | **DELETE** /auth/access-client | Disconnect the current access client
[**forgottenPasswordRequest**](AuthApi.md#forgottenPasswordRequest) | **POST** /auth/forgotten-password/request | Requests a forgotten password, notifying the user with instructions to reset it 
[**getCurrentAuth**](AuthApi.md#getCurrentAuth) | **GET** /auth | Returns data about the currently authenticated user
[**getDataForChangeForgottenPassword**](AuthApi.md#getDataForChangeForgottenPassword) | **GET** /auth/forgotten-password/data-for-change | Returns configuration data used to change a forgotten password after the initial request 
[**getDataForLogin**](AuthApi.md#getDataForLogin) | **GET** /auth/data-for-login | Returns data containing the configuration for logging-in
[**getSecondaryPasswordInput**](AuthApi.md#getSecondaryPasswordInput) | **GET** /auth/session/secondary-password | Returns the data for a secondary access password input
[**login**](AuthApi.md#login) | **POST** /auth/session | Logs-in the currently authenticated user
[**logout**](AuthApi.md#logout) | **DELETE** /auth/session | Log-out the current session
[**newOtp**](AuthApi.md#newOtp) | **POST** /auth/otp | Generates a new One-Time-Password (OTP) for the authenticated user
[**validateSecondaryPassword**](AuthApi.md#validateSecondaryPassword) | **POST** /auth/session/secondary-password | Validates the current pending session


<a name="changeForgottenPassword"></a>
# **changeForgottenPassword**
> changeForgottenPassword(params)

Changes the a forgotten password after have completed the request 

Changes the password (if manual), or sends a new one by e-mail (if generated) after the forgotten password reset process is completed.  

### Example
```javascript
var Cyclos411Api = require('cyclos_411_api');

var apiInstance = new Cyclos411Api.AuthApi();

var params = new Cyclos411Api.ChangeForgottenPassword(); // ChangeForgottenPassword | The parameters for changing the password


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.changeForgottenPassword(params, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **params** | [**ChangeForgottenPassword**](ChangeForgottenPassword.md)| The parameters for changing the password | 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

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

<a name="disconnectCurrentClient"></a>
# **disconnectCurrentClient**
> disconnectCurrentClient(opts)

Disconnect the current access client

Changes the status of the access client used for authentication, disconnecting it. To be reused, it has to be activated again. 

### Example
```javascript
var Cyclos411Api = require('cyclos_411_api');
var defaultClient = Cyclos411Api.ApiClient.instance;

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

var apiInstance = new Cyclos411Api.AuthApi();

var opts = { 
  'confirmationPassword': "confirmationPassword_example" // String | The password used to confirm this action, if needed. The actual password type, if any, depends on the Cyclos configuration for the current channel. 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.disconnectCurrentClient(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **confirmationPassword** | **String**| The password used to confirm this action, if needed. The actual password type, if any, depends on the Cyclos configuration for the current channel.  | [optional] 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="forgottenPasswordRequest"></a>
# **forgottenPasswordRequest**
> forgottenPasswordRequest(params)

Requests a forgotten password, notifying the user with instructions to reset it 

Sends an e-mail (in the future SMS will be supported) with instructions on how to reset the password, in case it was forgotten. In order to work, the Cyclos configuration options, both to show the forgotten password link and to enable for users need to be set. 

### Example
```javascript
var Cyclos411Api = require('cyclos_411_api');

var apiInstance = new Cyclos411Api.AuthApi();

var params = new Cyclos411Api.ForgottenPasswordRequest(); // ForgottenPasswordRequest | The parameters for requesting a forgotten password reset


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.forgottenPasswordRequest(params, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **params** | [**ForgottenPasswordRequest**](ForgottenPasswordRequest.md)| The parameters for requesting a forgotten password reset | 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

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

<a name="getCurrentAuth"></a>
# **getCurrentAuth**
> Auth getCurrentAuth(opts)

Returns data about the currently authenticated user

Returns the logged user information. 

### Example
```javascript
var Cyclos411Api = require('cyclos_411_api');

var apiInstance = new Cyclos411Api.AuthApi();

var opts = { 
  'fields': ["fields_example"] // [String] | Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getCurrentAuth(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **fields** | [**[String]**](String.md)| Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: &#x60;a,b.b1,c.-c1,c.-c2&#x60; will return the fields &#x60;a&#x60;, &#x60;b&#x60; (containing only the &#x60;b1&#x60; field) and &#x60;c&#x60; (containing all its fields except for &#x60;c1&#x60; or &#x60;c2&#x60;).   | [optional] 

### Return type

[**Auth**](Auth.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="getDataForChangeForgottenPassword"></a>
# **getDataForChangeForgottenPassword**
> DataForChangeForgottenPassword getDataForChangeForgottenPassword(key, opts)

Returns configuration data used to change a forgotten password after the initial request 

After the user has requested a forgotten password reset, using the &#x60;POST /auth/forgotten-password/request&#x60; path, the link on the received e-mail will contain a key which can be used to actually change the password. This key must be passed to this operation in order to request input on the new password, and maybe confirm the security question, depending on the Cyclos configuration.  

### Example
```javascript
var Cyclos411Api = require('cyclos_411_api');

var apiInstance = new Cyclos411Api.AuthApi();

var key = "key_example"; // String | The validation key which was sent by e-mail to the user

var opts = { 
  'fields': ["fields_example"] // [String] | Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getDataForChangeForgottenPassword(key, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **key** | **String**| The validation key which was sent by e-mail to the user | 
 **fields** | [**[String]**](String.md)| Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: &#x60;a,b.b1,c.-c1,c.-c2&#x60; will return the fields &#x60;a&#x60;, &#x60;b&#x60; (containing only the &#x60;b1&#x60; field) and &#x60;c&#x60; (containing all its fields except for &#x60;c1&#x60; or &#x60;c2&#x60;).   | [optional] 

### Return type

[**DataForChangeForgottenPassword**](DataForChangeForgottenPassword.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="getDataForLogin"></a>
# **getDataForLogin**
> DataForLogin getDataForLogin(opts)

Returns data containing the configuration for logging-in

Contains data useful for login, such as the allowed user identification methods, the password type and data for the forgot password request. 

### Example
```javascript
var Cyclos411Api = require('cyclos_411_api');

var apiInstance = new Cyclos411Api.AuthApi();

var opts = { 
  'fields': ["fields_example"] // [String] | Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getDataForLogin(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **fields** | [**[String]**](String.md)| Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: &#x60;a,b.b1,c.-c1,c.-c2&#x60; will return the fields &#x60;a&#x60;, &#x60;b&#x60; (containing only the &#x60;b1&#x60; field) and &#x60;c&#x60; (containing all its fields except for &#x60;c1&#x60; or &#x60;c2&#x60;).   | [optional] 

### Return type

[**DataForLogin**](DataForLogin.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="getSecondaryPasswordInput"></a>
# **getSecondaryPasswordInput**
> PasswordInput getSecondaryPasswordInput()

Returns the data for a secondary access password input

Returns the data for a secondary access password input. Only if there is secondary access password configured for the channel. 

### Example
```javascript
var Cyclos411Api = require('cyclos_411_api');
var defaultClient = Cyclos411Api.ApiClient.instance;

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

var apiInstance = new Cyclos411Api.AuthApi();

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getSecondaryPasswordInput(callback);
```

### Parameters
This endpoint does not need any parameter.

### Return type

[**PasswordInput**](PasswordInput.md)

### Authorization

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

### HTTP request headers

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

<a name="login"></a>
# **login**
> Auth login(opts)

Logs-in the currently authenticated user

Logs-in the currently authenticated user, returning the session token. This token can then be used on subsequent requests. After finishing the session, the user can then logout by sending an HTTP DELETE to /auth. 

### Example
```javascript
var Cyclos411Api = require('cyclos_411_api');
var defaultClient = Cyclos411Api.ApiClient.instance;

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

// Configure HTTP basic authorization: basic
var basic = defaultClient.authentications['basic'];
basic.username = 'YOUR USERNAME';
basic.password = 'YOUR PASSWORD';

var apiInstance = new Cyclos411Api.AuthApi();

var opts = { 
  'fields': ["fields_example"], // [String] | Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
  'cookie': true, // Boolean | If true then the server add the `Session-Token` cookie to the response  containing only the second half of the session token. 
  'timeoutInSeconds': 56 // Number | The timeout in seconds for the created session. If this value is not given or it is greater than that for the channel then the timeout  for the channel will be used. 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.login(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **fields** | [**[String]**](String.md)| Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: &#x60;a,b.b1,c.-c1,c.-c2&#x60; will return the fields &#x60;a&#x60;, &#x60;b&#x60; (containing only the &#x60;b1&#x60; field) and &#x60;c&#x60; (containing all its fields except for &#x60;c1&#x60; or &#x60;c2&#x60;).   | [optional] 
 **cookie** | **Boolean**| If true then the server add the &#x60;Session-Token&#x60; cookie to the response  containing only the second half of the session token.  | [optional] 
 **timeoutInSeconds** | **Number**| The timeout in seconds for the created session. If this value is not given or it is greater than that for the channel then the timeout  for the channel will be used.  | [optional] 

### Return type

[**Auth**](Auth.md)

### Authorization

[accessClient](../README.md#accessClient), [basic](../README.md#basic)

### HTTP request headers

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

<a name="logout"></a>
# **logout**
> logout(opts)

Log-out the current session

Invalidates the session used for authentication

### Example
```javascript
var Cyclos411Api = require('cyclos_411_api');
var defaultClient = Cyclos411Api.ApiClient.instance;

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

var apiInstance = new Cyclos411Api.AuthApi();

var opts = { 
  'cookie': true // Boolean | If true then the server add the `Session-Token` cookie with a null value to erase it.  
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.logout(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **cookie** | **Boolean**| If true then the server add the &#x60;Session-Token&#x60; cookie with a null value to erase it.   | [optional] 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="newOtp"></a>
# **newOtp**
> [&#39;String&#39;] newOtp(medium)

Generates a new One-Time-Password (OTP) for the authenticated user

Sends a new OTP for the authenticated user. Used when the confirmation password of a specific action. Used when &#x60;PasswordInput.mode&#x60; is &#x60;otp&#x60;.  

### Example
```javascript
var Cyclos411Api = require('cyclos_411_api');
var defaultClient = Cyclos411Api.ApiClient.instance;

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

// Configure HTTP basic authorization: basic
var basic = defaultClient.authentications['basic'];
basic.username = 'YOUR USERNAME';
basic.password = 'YOUR PASSWORD';

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

var apiInstance = new Cyclos411Api.AuthApi();

var medium = "medium_example"; // String | The medium the user wants to receive the OTP Possible values are: * email: The user will receive an email with the information * sms: The user will receive a sms with the information (only if there is at least one phone enabled for sms) 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.newOtp(medium, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **medium** | **String**| The medium the user wants to receive the OTP Possible values are: * email: The user will receive an email with the information * sms: The user will receive a sms with the information (only if there is at least one phone enabled for sms)  | 

### Return type

**[&#39;String&#39;]**

### Authorization

[accessClient](../README.md#accessClient), [basic](../README.md#basic), [session](../README.md#session)

### HTTP request headers

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

<a name="validateSecondaryPassword"></a>
# **validateSecondaryPassword**
> validateSecondaryPassword(password)

Validates the current pending session

Validates a pending session using the secondary access password (if any) configured for the current channel. 

### Example
```javascript
var Cyclos411Api = require('cyclos_411_api');
var defaultClient = Cyclos411Api.ApiClient.instance;

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

var apiInstance = new Cyclos411Api.AuthApi();

var password = "password_example"; // String | The secondary access password 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.validateSecondaryPassword(password, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **password** | **String**| The secondary access password  | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

