# CloudSmlApi.AuthApi

All URIs are relative to *https://localhost/api/v1*

Method | HTTP request | Description
------------- | ------------- | -------------
[**createOauthClient**](AuthApi.md#createOauthClient) | **POST** /auth/oauth2_clients/ | Create a new OAuth2 Client
[**getOAuth2Clients**](AuthApi.md#getOAuth2Clients) | **GET** /auth/oauth2_clients/ | List of OAuth2 Clients
[**optionsOAuth2Clients**](AuthApi.md#optionsOAuth2Clients) | **OPTIONS** /auth/oauth2_clients/ | Check which methods are allowed


<a name="createOauthClient"></a>
# **createOauthClient**
> DetailedOAuth2Client createOauthClient(defaultScopes, opts)

Create a new OAuth2 Client

**PERMISSIONS: At least Active user is required.**   Essentially, OAuth2 Client is a &#x60;&#x60;client_id&#x60;&#x60; and &#x60;&#x60;client_secret&#x60;&#x60; pair associated with a user.

### Example
```javascript
var CloudSmlApi = require('cloud_sml_api');
var defaultClient = CloudSmlApi.ApiClient.default;

// Configure OAuth2 access token for authorization: oauth2_password
var oauth2_password = defaultClient.authentications['oauth2_password'];
oauth2_password.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new CloudSmlApi.AuthApi();

var defaultScopes = ["defaultScopes_example"]; // [String] | 

var opts = { 
  'redirectUris': ["redirectUris_example"] // [String] | 
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **defaultScopes** | [**[String]**](String.md)|  | 
 **redirectUris** | [**[String]**](String.md)|  | [optional] 

### Return type

[**DetailedOAuth2Client**](DetailedOAuth2Client.md)

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/x-www-form-urlencoded, multipart/form-data
 - **Accept**: application/json

<a name="getOAuth2Clients"></a>
# **getOAuth2Clients**
> [BaseOAuth2Client] getOAuth2Clients(userId, opts)

List of OAuth2 Clients

**PERMISSIONS: At least Active user is required.**   Returns a list of OAuth2 Clients starting from &#x60;&#x60;offset&#x60;&#x60; limited by &#x60;&#x60;limit&#x60;&#x60; parameter.

### Example
```javascript
var CloudSmlApi = require('cloud_sml_api');
var defaultClient = CloudSmlApi.ApiClient.default;

// Configure OAuth2 access token for authorization: oauth2_password
var oauth2_password = defaultClient.authentications['oauth2_password'];
oauth2_password.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new CloudSmlApi.AuthApi();

var userId = 56; // Number | 

var opts = { 
  'offset': 56, // Number | a number of items to skip, default is 0.
  'limit': 20 // Number | limit a number of items (allowed range is 1-100), default is 20.
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **userId** | **Number**|  | 
 **offset** | **Number**| a number of items to skip, default is 0. | [optional] 
 **limit** | **Number**| limit a number of items (allowed range is 1-100), default is 20. | [optional] [default to 20]

### Return type

[**[BaseOAuth2Client]**](BaseOAuth2Client.md)

### Authorization

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

### HTTP request headers

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

<a name="optionsOAuth2Clients"></a>
# **optionsOAuth2Clients**
> optionsOAuth2Clients()

Check which methods are allowed

**PERMISSIONS: At least Active user is required.**   Use this method if you need to know what operations are allowed to be performed on this endpoint, e.g. to decide wether to display a button in your UI.  The list of allowed methods is provided in &#x60;Allow&#x60; response header.

### Example
```javascript
var CloudSmlApi = require('cloud_sml_api');
var defaultClient = CloudSmlApi.ApiClient.default;

// Configure OAuth2 access token for authorization: oauth2_password
var oauth2_password = defaultClient.authentications['oauth2_password'];
oauth2_password.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new CloudSmlApi.AuthApi();

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

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

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

