> ## Documentation Index
> Fetch the complete documentation index at: https://help.cryptolens.io/llms.txt
> Use this file to discover all available pages before exploring further.

# .NET: Auth

> Signatures, models and behavior for SKM.V3.Methods.Auth in the .NET SDK 4.0.54.

Methods that related to authentication. A complete list
can be found here: [Auth](/api-reference/generated/Auth)

**Namespace:** `SKM.V3.Methods`\
**Version:** 4.0.54. Both packages; all six documented target frameworks.

<CodeGroup>
  ```csharp C# theme={null}
  public class Auth
  ```

  ```vb VB.NET theme={null}
  Public Class Auth
  ```
</CodeGroup>

These methods return a result object. Check `Result == ResultType.Success` before using its data. In version 4.0.54, handled request and JSON errors normally return `ResultType.Error` with a diagnostic `Message`. A non-null result alone does not mean the request succeeded. See [Request Errors](/libraries/dotnet-reference/settings#request-errors).

## Constructors

<a id="ctor-e842514d3c" />

### Auth()

Creates an empty Auth object. This constructor does not send an API request.

<CodeGroup>
  ```csharp C# theme={null}
  public Auth()
  ```

  ```vb VB.NET theme={null}
  Public Sub New()
  ```
</CodeGroup>

## Methods

<a id="key-lock-c77cd6c461" />

### KeyLock(string, KeyLockModel)

This method will, given a license key, generate a new access token
that is locked to that particular key and return the Id of that key.
The scope of the access token is preserved (i.e. all methods that were
enabled in the access token used to access this method will be copied
to the new access token) except for the key lock, which is going to be
changed to the id of the license key. Note, for this method to work,
the access token used to access this method has to have key lock set
to -1. All of these details are described in Remarks.

<CodeGroup>
  ```csharp C# theme={null}
  public static KeyLockResult KeyLock(string token, KeyLockModel parameters)
  ```

  ```vb VB.NET theme={null}
  Public Shared Function KeyLock(token As String, parameters As KeyLockModel) As KeyLockResult
  ```
</CodeGroup>

[Web API Reference](/api-reference/generated/KeyLock)

**Parameters**

| Name | Type | Description |
| - | - | - |
| `token` | `string` | The access token. Read more at [Auth](/api-reference/generated/Auth) |
| `parameters` | [`KeyLockModel`](/libraries/dotnet-reference/models/key-lock-model) | The parameters that the method needs |

**Returns:** [`KeyLockResult`](/libraries/dotnet-reference/models/key-lock-result). The API response. Check `Result` and `Message` before using the returned data.

Note: for more details, please see
[KeyLock](/api-reference/generated/KeyLock)

[.NET SDK Reference](/libraries/dotnet-api) · [Reviewed Source Revision](https://github.com/Cryptolens/cryptolens-dotnet/tree/30aaf399ba53d9a111bee896c35bf557fa219394)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.