---
title: "Basic Security"
canonical: "https://docs.dk.is/space/DEV/10357642/Basic%20Security"
format: markdown
---
The most common authentication method is using the TBasicSecurity for authentication where you need to supply a username and passwordStep-by-step guide


##### **Example using C#**

```csharp
var client = new IItemServiceservice() { BasicSecurityValue = new BasicSecurity() { Username = "myuser", Password = "mypass" } };
```


##### **Example using Delphi**

```delphi
function TMedicorThread.GetWsInterface : IItemService;
var
  sec : BasicSecurity;
begin
  TimeOut := 180000;
  result := GetIItemService(false,fWebserviceURL);
  sec := BasicSecurity.Create;
  sec.Username := fUserName;
  sec.Password := fPassword;
  result as ISOAPHeaders).Send( sec );
end;
```


##### **Example using PHP**

```php
$BS = new BasicSecurity();   
$BS->Username = "MyUsr";
$BS->Password = "MyPass";
			   
$client = new SoapClient("file://C:/TestClient/dkWSDL_4_2_0.wsdl" ,array("soap_version" => SOAP_1_1, "trace" => 1, "cache_wsdl" => WSDL_CACHE_NONE));      
$Header = new SoapHeader("urn:dkWSValueObjects","BasicSecurity" , $BS, false);       
$client->__setSoapHeaders($Header);
```





 Related articles



> Macro (contentbylabel)


> Macro (details)
> 
> | **Related issues** |  |
> | --- | --- |