# Require organization sign-in on managed computers

> For the complete documentation index, see [llms.txt](https://docs.ringleader.dev/llms.txt).


> Make Ringleader on a company Mac or Windows PC run only after someone signs in to your organization.


Make Ringleader on a company Mac or Windows PC run only after someone signs in to your
organization. Your organization's rules for its members' computers arrive when someone signs in,
and a person with administrator rights on the computer can sign out or delete `~/.ringleader`
and take the rules with them. With this setting, `rl` and the Ringleader application do nothing
until someone signs in to your Ringleader console as a member of your organization.

## Prerequisites

- A Mac or Windows PC that your company manages with a tool such as Jamf or Intune.
  [Deploy Ringleader with a device management tool](https://docs.ringleader.dev/guides/deploy-with-device-management/)
  installs Ringleader on it. A Linux computer never reads the setting.
- The address people sign in to and your organization's name, spelled exactly as Ringleader
  spells it. The examples use `https://app.ringleader.dev` and `acme`. Replace them with
  yours.

## Set the two values

Set two values on each computer from your device management tool:

- `ControlPlaneURL`: the address people sign in to, such as `https://app.ringleader.dev`.
- `Org`: your organization's name, spelled exactly as Ringleader spells it.

`rl` compares each value with the sign-in exactly, so write them like this:

- Write `ControlPlaneURL` the way people sign in. `https://cp.example.com:443` and
  `https://cp.example.com` count as two different addresses.
- Write `Org` with the same capitals Ringleader uses.
- Set both values. If one is missing, `rl` refuses every command and names the missing value.


### macOS


1. Start from this profile, to upload the setting as a `.mobileconfig` file:

   ```xml
   <?xml version="1.0" encoding="UTF-8"?>
   <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
   <plist version="1.0">
   <dict>
     <key>PayloadContent</key>
     <array>
       <dict>
         <key>PayloadType</key>
         <string>dev.ringleader.app</string>
         <key>PayloadIdentifier</key>
         <string>com.example.ringleader.settings</string>
         <key>PayloadUUID</key>
         <string>00000000-0000-0000-0000-000000000001</string>
         <key>PayloadVersion</key>
         <integer>1</integer>
         <key>ControlPlaneURL</key>
         <string>https://app.ringleader.dev</string>
         <key>Org</key>
         <string>acme</string>
       </dict>
     </array>
     <key>PayloadDisplayName</key>
     <string>Ringleader</string>
     <key>PayloadIdentifier</key>
     <string>com.example.ringleader</string>
     <key>PayloadScope</key>
     <string>System</string>
     <key>PayloadType</key>
     <string>Configuration</string>
     <key>PayloadUUID</key>
     <string>00000000-0000-0000-0000-000000000002</string>
     <key>PayloadVersion</key>
     <integer>1</integer>
   </dict>
   </plist>
   ```

2. Change the two values, and put a UUID of your own in each `PayloadUUID`.
3. Set the profile to install on the computer, not for a user, with the preference domain
   `dev.ringleader.app` and `ControlPlaneURL` and `Org` as string keys. A profile installed at
   user scope lands somewhere else, and `rl` does not read it.
4. Push the profile from your device management tool. macOS writes the values to
   `/Library/Managed Preferences/dev.ringleader.app.plist`, the only place `rl` reads them.
5. On a Mac, run this in Terminal. It prints both values when the profile is in place:

   ```bash
   plutil -p "/Library/Managed Preferences/dev.ringleader.app.plist"
   ```



### Windows


1. Write two `REG_SZ` values, `ControlPlaneURL` and `Org`, under
   `HKEY_LOCAL_MACHINE\Software\Policies\Ringleader`. `rl` never reads `HKEY_CURRENT_USER`. A
   value of another type, such as a `REG_DWORD`, cannot be read, and `rl` then refuses to run.
2. To write them, run this in PowerShell opened as an administrator, or from a script your
   device management tool runs:

   ```powershell
   New-Item -Path 'HKLM:\Software\Policies\Ringleader' -Force | Out-Null
   Set-ItemProperty -Path 'HKLM:\Software\Policies\Ringleader' -Name ControlPlaneURL -Value 'https://app.ringleader.dev' -Type String
   Set-ItemProperty -Path 'HKLM:\Software\Policies\Ringleader' -Name Org -Value 'acme' -Type String
   ```






## Ask people to sign in

Ask each person to sign in, with `rl auth login` or on the desktop application's sign-in screen.
A person who signed in before the setting arrived must sign in again, because that sign-in did
not check their organization.

## Check the sign-in on a managed computer

Until someone signs in to `ControlPlaneURL` as a member of `Org`, `rl` refuses every command
except these:

- `rl auth login`, `rl auth logout` and `rl auth status`.
- `rl daemon stop` and `rl daemon status`.
- `rl upgrade`, so the computer can still get updates.
- Help, `rl version`, `rl docs`, `rl licenses` and shell completion.

The Ringleader daemon does not start, and a daemon that is already running stops within about
20 seconds. The desktop application shows only a **Sign in to your organization** screen, which
names the console and the organization.

1. Run any other command before signing in, such as `rl workstation get`. It stops and prints
   its own name, then a message that says where to sign in:

   ```text
   workstation get: this computer is managed, and no one is signed in to
   https://app.ringleader.dev. Sign in as a member of the acme org: rl auth login
   https://app.ringleader.dev
   ```

2. Sign in. With no address, `rl auth login` signs in to `ControlPlaneURL`:

   ```bash
   rl auth login
   ```

   When the sign-in succeeds, `rl` asks Ringleader which organizations the person
   belongs to, and keeps the sign-in only if `Org` is one of them. A person belongs to an
   organization when they hold an organization role, or access to any of its namespaces, as a
   collaborator does. The computer also fetches your organization's rules for it again.
3. Run `rl auth status`. Its `Managed:` line shows where the computer stands:

   ```text
   Managed:     signed in to https://app.ringleader.dev as a member of the acme org
   ```

`rl auth logout` deletes the sign-in, and `rl` refuses again until the next one.

## Troubleshoot

- **If `rl workstation get` says the sign-in is not confirmed for the org,** the person signed in
  before the setting arrived. Sign in again with the command the message names:

  ```text
  workstation get: this computer is managed, and the sign-in to https://app.ringleader.dev is
  not confirmed for the acme org. Sign in again: rl auth login https://app.ringleader.dev
  ```

- **If `rl auth login` refuses and keeps nothing,** one of these is true:
  - It was given an address other than `ControlPlaneURL`.
  - It was run with `--anonymous`, because an anonymous sign-in cannot show which organization
    the person belongs to.
  - The person is not a member of `Org`.
  - Ringleader cannot say which organizations the person belongs to, as with a Ringleader
    deployment on an older release.
- **If `rl` refuses every command with a message about the managed setting,** `rl` cannot read
  the setting, or one of its values is missing. The desktop application shows the same problem
  in place of its sign-in screen. A setting with one value missing gives:

  ```text
  this computer's managed setting in HKLM\Software\Policies\Ringleader has no Org value, so rl
  cannot run. Ask your administrator to set Org
  ```

  A setting `rl` cannot read at all, such as a registry value of the wrong type or a profile
  file `plutil` cannot read, gives `rl cannot read this computer's managed setting:`, followed
  by the error and `Ask your administrator to check it`. To clear either one, fix or remove the
  values on the computer.

## Next steps

- [Limits of the sign-in requirement](https://docs.ringleader.dev/security/model/protection-limits/#limits-of-the-sign-in-requirement)
  says what an administrator of the computer can still do.
- [Rules your organization sets for your computer](https://docs.ringleader.dev/security/model/enforced-protections/#rules-your-organization-sets-for-your-computer)
  lists the rules that a sign-in brings to the computer.
- [Authentication commands](https://docs.ringleader.dev/reference/cli/commands/authentication/) lists every `rl auth` command and flag.

