Authentication

An authorization token is required in order for the client to send requests to the REST API. This token is validated by Crestron Home, which responds with an authentication key if the validation is successful. The authentication key is used throughout the session between the client and server. To retrieve the authentication key and begin the session, the client must send a login request with the associated authorization token. For more information on generating an authorization token, refer to Web Authorization Token.

The end the session, the client must send a logout request. The server maintains an idle timeout limit of 10 minutes per authorization key. If the key is invalid or has expired, the server returns an HTTP status code of 401 (unauthorized) or 511 (network authentication required). When the client receives the 401 or 511 status code, the client must send a new login request to get another authentication key. Refer to the following control flow diagram.

For more information on formatting the login and logout requests, refer to API Reference.

NOTE: It is required that the authentication key has an idle timeout limit. The suggested duration for this limit is 10 minutes. If the time limit is increased, then the existing authentication key will expire. The client must send a new login request to restart communication with the server.