Reader small image

You're reading from  Apache Mesos Cookbook

Product typeBook
Published inAug 2017
PublisherPackt
ISBN-139781785884627
Edition1st Edition
Right arrow
Authors (2):
David Blomquist
David Blomquist
author image
David Blomquist

David Blomquist been working with computers since the 1980s. His first computer was an Apple Macintosh and the first networked computer he managed was a 10 terminal Xenix system. Since that time, David has held positions in virtually every area of IT, including operations, development, and architecture. David now specializes in designing Big Data, HPC, and Grid Computing systems with applications in Health Care and Science. Most recently, he has designed and deployed several large-scale clusters for the Federal Government.
Read more about David Blomquist

View More author details
Right arrow

Enabling basic access authentication


In this recipe, you will learn how to enable HTTP basic authentication to limit a user who can access the Marathon API.

Getting ready

Before you start, ensure Marathon is up and running. Before applying any authentication, ensure you enabled SSL to protect secrets from eavesdropping.

How to do it...

Update the configuration with credentials:

echo MARATHON_HTTP_CREDENTIALS=username:password >> /etc/default/marathon

Check the API requires authentication:

curl -k https://localhost:8443/ping

The preceding command should return a 401 Unauthorized code, while the following command should work. From now, all interactions with Marathon require passing credentials:

curl -k -u username:password https://localhost:8443/ping

How it works...

When HTTP credentials are passed to Marathon, it checks HTTP request headers for credentials and compares them with those configured. When no credentials are provided or the provided credentials don't match, it returns a 401 error code...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Apache Mesos Cookbook
Published in: Aug 2017Publisher: PacktISBN-13: 9781785884627

Authors (2)

author image
David Blomquist

David Blomquist been working with computers since the 1980s. His first computer was an Apple Macintosh and the first networked computer he managed was a 10 terminal Xenix system. Since that time, David has held positions in virtually every area of IT, including operations, development, and architecture. David now specializes in designing Big Data, HPC, and Grid Computing systems with applications in Health Care and Science. Most recently, he has designed and deployed several large-scale clusters for the Federal Government.
Read more about David Blomquist