public. Authenticate a user given http header Credentials or an auth token. When using external authentication, this will automatically create an account and synchronize groups. Response status 200 implies valid credentials and contains a new auth token.
If the login credentials are valid, this feature returns an authentication token in the response text and an 'authtoken' cookie. This cookie can be used with subsequent requests to execute using the login credentials.
This feature is identical to GET:users/authenticate, except that it automatically creates new users when using external authentication.
The following code example authenticates the the "admin" user using the local authentication service:
Plug p = Plug.New("http://deki-hayes/@api/deki");
DreamMessage msg = p.At("users", "authenticate").WithCredentials("admin", "password").Post();
String cookieText = msg.Cookies[0].ToString(); Sample authtoken cookie contents:
$Version=1; authtoken=1_633245325345625000_12276545af9bf1f3c24c382c7211760a; $Path=/; $Domain=deki-hayes