Testing Perimeter Security
To ensure that you've configured security correctly, run these simple tests to verify that the security components are working as expected. For information on the conventions used for these examples, see CDAP Microservices. Note that if SSL is enabled for CDAP servers, then the base URL used in these examples will use https
 instead of http
.
After configuring CDAP as described above, start (or restart) CDAP and attempt to make a request:
GET /v3/apps
such as:
This should return a 401 Unauthorized
 response with a list of authentication URIs in the response body. For example:
Submit a username and password to one of the authentication URIs (
<auth-uri>
) to obtain anÂAccessToken
 by submitting a Basic Authorization header with the username and password:UsingÂ
curl
, assuming a CDAP authentication server at the URIÂlocalhost:10009
 and that you have defined a username:password pair such asÂcdap:bigdata
 in the realm file, you can useÂcurl
'sÂ-u
 option to create the header:
This should return aÂ
200 OK
 response with theÂAccessToken
 string in the response body (formatted to fit):Reattempt the first command, but this time include theÂ
access_token
 as a header in the request:such as (formatted to fit):
This should return a 200 OK
 response.
Visiting the CDAP UI should redirect you to a login page that prompts for credentials. Entering the credentials that you have configured should let you work with the CDAP UI as normal.
Created in 2020 by Google Inc.