# PowerIAM.AuthApi

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

Method | HTTP request | Description
------------- | ------------- | -------------
[**authenticate**](AuthApi.md#authenticate) | **POST** /v2/authenticate | 
[**confirmAccount**](AuthApi.md#confirmAccount) | **POST** /v2/confirm-account | 
[**connectIdentity**](AuthApi.md#connectIdentity) | **POST** /v2/connect-identity | 
[**createAccount**](AuthApi.md#createAccount) | **POST** /v2/create-account | 
[**forgetPassword**](AuthApi.md#forgetPassword) | **POST** /v2/forget-password | 
[**getAuthenticationMethods**](AuthApi.md#getAuthenticationMethods) | **GET** /v2/get-authentication-methods | 
[**resetPassword**](AuthApi.md#resetPassword) | **POST** /v2/reset-password | 
[**sendEmailVerificationEmail**](AuthApi.md#sendEmailVerificationEmail) | **POST** /v2/send-email-verification-email | 
[**verifyEmail**](AuthApi.md#verifyEmail) | **POST** /v2/verify-email | 

<a name="authenticate"></a>
# **authenticate**
> &#x27;String&#x27; authenticate(body)



Authenticate a user. Pass either Oidc- or Password credentials, not both.

### Example
```javascript
import {PowerIAM} from '@poweriam/sdk';

let apiInstance = new PowerIAM.AuthApi();
let body = new PowerIAM.AuthenticateCommandV2(); // AuthenticateCommandV2 | 

apiInstance.authenticate(body, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

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

### Return type

**&#x27;String&#x27;**

### Authorization

No authorization required

### HTTP request headers

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

<a name="confirmAccount"></a>
# **confirmAccount**
> UserV2 confirmAccount(body)



Confirm account details.

### Example
```javascript
import {PowerIAM} from '@poweriam/sdk';
let defaultClient = PowerIAM.ApiClient.instance;

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

let apiInstance = new PowerIAM.AuthApi();
let body = new PowerIAM.ConfirmAccountCommandV2(); // ConfirmAccountCommandV2 | 

apiInstance.confirmAccount(body, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

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

### Return type

[**UserV2**](UserV2.md)

### Authorization

[JWT Token](../README.md#JWT Token)

### HTTP request headers

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

<a name="connectIdentity"></a>
# **connectIdentity**
> IdentityV2 connectIdentity(body)



Connect an identity provider identity to the account.

### Example
```javascript
import {PowerIAM} from '@poweriam/sdk';
let defaultClient = PowerIAM.ApiClient.instance;

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

let apiInstance = new PowerIAM.AuthApi();
let body = new PowerIAM.ConnectIdentityCommandV2(); // ConnectIdentityCommandV2 | 

apiInstance.connectIdentity(body, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

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

### Return type

[**IdentityV2**](IdentityV2.md)

### Authorization

[JWT Token](../README.md#JWT Token)

### HTTP request headers

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

<a name="createAccount"></a>
# **createAccount**
> UserV2 createAccount(body)



Create a user account.

### Example
```javascript
import {PowerIAM} from '@poweriam/sdk';

let apiInstance = new PowerIAM.AuthApi();
let body = new PowerIAM.CreateAccountCommandV2(); // CreateAccountCommandV2 | 

apiInstance.createAccount(body, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

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

### Return type

[**UserV2**](UserV2.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="forgetPassword"></a>
# **forgetPassword**
> &#x27;String&#x27; forgetPassword(body)



Request resetting of password because it has been forgotten by the user.

### Example
```javascript
import {PowerIAM} from '@poweriam/sdk';

let apiInstance = new PowerIAM.AuthApi();
let body = new PowerIAM.ForgetPasswordCommandV2(); // ForgetPasswordCommandV2 | 

apiInstance.forgetPassword(body, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

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

### Return type

**&#x27;String&#x27;**

### Authorization

No authorization required

### HTTP request headers

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

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



Get all available authentication methods.

### Example
```javascript
import {PowerIAM} from '@poweriam/sdk';

let apiInstance = new PowerIAM.AuthApi();
let opts = { 
  'redirectUrl': "redirectUrl_example", // String | 
  'responseMode': new PowerIAM.OidcResponseModeV2() // OidcResponseModeV2 | 
};
apiInstance.getAuthenticationMethods(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **redirectUrl** | **String**|  | [optional] 
 **responseMode** | [**OidcResponseModeV2**](.md)|  | [optional] 

### Return type

[**AuthenticationMethodsV2**](AuthenticationMethodsV2.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="resetPassword"></a>
# **resetPassword**
> &#x27;String&#x27; resetPassword(body)



Reset the password by setting the specified new one.

### Example
```javascript
import {PowerIAM} from '@poweriam/sdk';

let apiInstance = new PowerIAM.AuthApi();
let body = new PowerIAM.ResetPasswordCommandV2(); // ResetPasswordCommandV2 | 

apiInstance.resetPassword(body, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

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

### Return type

**&#x27;String&#x27;**

### Authorization

No authorization required

### HTTP request headers

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

<a name="sendEmailVerificationEmail"></a>
# **sendEmailVerificationEmail**
> &#x27;String&#x27; sendEmailVerificationEmail(body)



Send an email verification link to the user&#x27;s email address.

### Example
```javascript
import {PowerIAM} from '@poweriam/sdk';

let apiInstance = new PowerIAM.AuthApi();
let body = new PowerIAM.SendEmailVerificationEmailCommandV2(); // SendEmailVerificationEmailCommandV2 | 

apiInstance.sendEmailVerificationEmail(body, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

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

### Return type

**&#x27;String&#x27;**

### Authorization

No authorization required

### HTTP request headers

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

<a name="verifyEmail"></a>
# **verifyEmail**
> &#x27;String&#x27; verifyEmail(body)



Verify an email address belongs to the user.

### Example
```javascript
import {PowerIAM} from '@poweriam/sdk';

let apiInstance = new PowerIAM.AuthApi();
let body = new PowerIAM.VerifyEmailCommandV2(); // VerifyEmailCommandV2 | 

apiInstance.verifyEmail(body, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

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

### Return type

**&#x27;String&#x27;**

### Authorization

No authorization required

### HTTP request headers

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

