# \AuthApi

All URIs are relative to *https://registry.example.com*

Method | HTTP request | Description
------------- | ------------- | -------------
[**disable_totp**](AuthApi.md#disable_totp) | **POST** /api/v1/auth/totp/disable | Disable TOTP two-factor authentication
[**enable_totp**](AuthApi.md#enable_totp) | **POST** /api/v1/auth/totp/enable | Enable TOTP two-factor authentication
[**get_current_user**](AuthApi.md#get_current_user) | **GET** /api/v1/auth/me | Get current user
[**login**](AuthApi.md#login) | **POST** /api/v1/auth/login | Authenticate user
[**logout**](AuthApi.md#logout) | **POST** /api/v1/auth/logout | Logout user
[**refresh_token**](AuthApi.md#refresh_token) | **POST** /api/v1/auth/refresh | Refresh access token
[**setup_totp**](AuthApi.md#setup_totp) | **POST** /api/v1/auth/totp/setup | Generate TOTP secret
[**verify_totp**](AuthApi.md#verify_totp) | **POST** /api/v1/public/auth/totp/verify | Verify TOTP code during login



## disable_totp

> models::DisableTotp200Response disable_totp(disable_totp_request)
Disable TOTP two-factor authentication

Disables TOTP two-factor authentication for the authenticated user after verifying their password and a valid TOTP code.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**disable_totp_request** | [**DisableTotpRequest**](DisableTotpRequest.md) |  | [required] |

### Return type

[**models::DisableTotp200Response**](disableTotp_200_response.md)

### Authorization

[apiKeyAuth](../README.md#apiKeyAuth), [bearerAuth](../README.md#bearerAuth)

### HTTP request headers

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

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## enable_totp

> models::TotpEnableResponse enable_totp(enable_totp_request)
Enable TOTP two-factor authentication

Verifies the provided TOTP code against the previously generated secret and enables TOTP for the authenticated user. Returns one-time backup codes.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**enable_totp_request** | [**EnableTotpRequest**](EnableTotpRequest.md) |  | [required] |

### Return type

[**models::TotpEnableResponse**](TotpEnableResponse.md)

### Authorization

[apiKeyAuth](../README.md#apiKeyAuth), [bearerAuth](../README.md#bearerAuth)

### HTTP request headers

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

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## get_current_user

> models::User get_current_user()
Get current user

Returns the profile of the currently authenticated user.

### Parameters

This endpoint does not need any parameter.

### Return type

[**models::User**](User.md)

### Authorization

[apiKeyAuth](../README.md#apiKeyAuth), [bearerAuth](../README.md#bearerAuth)

### HTTP request headers

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

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## login

> models::TokenPair login(login_request)
Authenticate user

Authenticates a user with username and password credentials and returns access and refresh tokens.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**login_request** | [**LoginRequest**](LoginRequest.md) |  | [required] |

### Return type

[**models::TokenPair**](TokenPair.md)

### Authorization

No authorization required

### HTTP request headers

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

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## logout

> logout()
Logout user

Invalidates the current session and associated tokens.

### Parameters

This endpoint does not need any parameter.

### Return type

 (empty response body)

### Authorization

[apiKeyAuth](../README.md#apiKeyAuth), [bearerAuth](../README.md#bearerAuth)

### HTTP request headers

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

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## refresh_token

> models::TokenPair refresh_token(refresh_token_request)
Refresh access token

Exchanges a valid refresh token for a new access and refresh token pair.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**refresh_token_request** | [**RefreshTokenRequest**](RefreshTokenRequest.md) |  | [required] |

### Return type

[**models::TokenPair**](TokenPair.md)

### Authorization

No authorization required

### HTTP request headers

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

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## setup_totp

> models::TotpSetupResponse setup_totp()
Generate TOTP secret

Generates a new TOTP secret and QR code URL for the authenticated user to configure their authenticator app.

### Parameters

This endpoint does not need any parameter.

### Return type

[**models::TotpSetupResponse**](TotpSetupResponse.md)

### Authorization

[apiKeyAuth](../README.md#apiKeyAuth), [bearerAuth](../README.md#bearerAuth)

### HTTP request headers

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

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## verify_totp

> models::VerifyTotp200Response verify_totp(verify_totp_request)
Verify TOTP code during login

Verifies a TOTP code as the second factor during the login flow. Accepts a temporary TOTP token issued after primary authentication and returns full access and refresh tokens upon successful verification.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**verify_totp_request** | [**VerifyTotpRequest**](VerifyTotpRequest.md) |  | [required] |

### Return type

[**models::VerifyTotp200Response**](verifyTotp_200_response.md)

### Authorization

No authorization required

### HTTP request headers

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

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

