Clockwork

php dev tools integrated to your browser

Clockwork screenshot Clockwork screenshot Clockwork screenshot

Authentication

The authentication in Clockwork works very simple. Each metadata request contains an authentication token, which is passed to the authenticator to decide whether we should return the metadata. If the Clockwork app receives a forbidden response, it will assume an authentication is required and asks for username, password or both as required by the authenticator. Submitting this form will make an authentication attempt on authenticator which will return a new authentication token when successful.

To create an authenticator implementation you will need to implement the Clockwork\Authentication\AuthenticatorInterface interface.

To use the custom authenticator we need to set it on the main Clockwork class:

clock()->setAuthenticator(new EloquentAuthenticator);

Feel free to take a look at existing authenticator implementations for inspiration.