---
title: realm
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/urlprotectionspace/realm
---

# realm

The receiver’s authentication realm

## Declaration

```swift
var realm: String? { get }
```

## Discussion

Discussion This value is nil if no realm has been set. A realm is generally only specified for HTTP and HTTPS authentication.

## See Also

### Getting protection space properties

- [authenticationMethod](foundation/urlprotectionspace/authenticationmethod.md)
- [distinguishedNames](foundation/urlprotectionspace/distinguishednames.md)
- [host](foundation/urlprotectionspace/host.md)
- [port](foundation/urlprotectionspace/port.md)
- [protocol](foundation/urlprotectionspace/protocol.md)
- [proxyType](foundation/urlprotectionspace/proxytype.md)
- [receivesCredentialSecurely](foundation/urlprotectionspace/receivescredentialsecurely.md)
- [serverTrust](foundation/urlprotectionspace/servertrust.md)
