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

# NSServiceAuth

> Properties for service authentication.

Properties for service authentication.

## Constructors

### NSServiceAuth()

```crmscript theme={null}
NSServiceAuth
```

Initializes a new instance of the NSServiceAuth class.

## Methods

## GetAuthType()

```crmscript theme={null}
String GetAuthType()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The type of authentication, plain-text, OAuth...

**Example:**

```crmscript theme={null}
NSServiceAuth thing;
String authType = thing.GetAuthType();
```

## GetPassword()

```crmscript theme={null}
String GetPassword()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The (decrypted) password or token.

**Example:**

```crmscript theme={null}
NSServiceAuth thing;
String password = thing.GetPassword();
```

## GetPort()

```crmscript theme={null}
Integer GetPort()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The server port.

**Example:**

```crmscript theme={null}
NSServiceAuth thing;
Integer port = thing.GetPort();
```

## GetServer()

```crmscript theme={null}
String GetServer()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The mail server.

**Example:**

```crmscript theme={null}
NSServiceAuth thing;
String server = thing.GetServer();
```

## GetServiceAuthId()

```crmscript theme={null}
Integer GetServiceAuthId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The primary key.

**Example:**

```crmscript theme={null}
NSServiceAuth thing;
Integer serviceAuthId = thing.GetServiceAuthId();
```

## GetUsername()

```crmscript theme={null}
String GetUsername()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The username.

**Example:**

```crmscript theme={null}
NSServiceAuth thing;
String username = thing.GetUsername();
```

## SetAuthType(String)

```crmscript theme={null}
Void SetAuthType(String authType)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSServiceAuth thing;
String authType;
thing.SetAuthType(authType);
```

## SetPassword(String)

```crmscript theme={null}
Void SetPassword(String password)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSServiceAuth thing;
String password;
thing.SetPassword(password);
```

## SetPort(Integer)

```crmscript theme={null}
Void SetPort(Integer port)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSServiceAuth thing;
Integer port;
thing.SetPort(port);
```

## SetServer(String)

```crmscript theme={null}
Void SetServer(String server)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSServiceAuth thing;
String server;
thing.SetServer(server);
```

## SetServiceAuthId(Integer)

```crmscript theme={null}
Void SetServiceAuthId(Integer serviceAuthId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSServiceAuth thing;
Integer serviceAuthId;
thing.SetServiceAuthId(serviceAuthId);
```

## SetUsername(String)

```crmscript theme={null}
Void SetUsername(String username)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSServiceAuth thing;
String username;
thing.SetUsername(username);
```


## Related topics

- [NSUserAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSUserAgent.md)
- [Delete Service Auth](/en/api/reference/restful/agent/user_agent/delete-service-auth.md)
- [service_auth table](/en/database/tables/service-auth.md)
- [Save Service Auth](/en/api/reference/restful/agent/user_agent/save-service-auth.md)
- [Get Service Auth](/en/api/reference/restful/agent/user_agent/get-service-auth.md)
- [Create Default Service Auth](/en/api/reference/restful/agent/user_agent/create-default-service-auth.md)
