{"login":"max","id":16xxx11,"avatar_url":"https://avatars0.githubusercontent.com/u/16xxx11?v=3","gravatar_id":"","url":"https://api.github.com/users/max ... ,"collaborators":0,"private_repos":0}}
To Set Up Basic Authentication (Design Center)
This procedure demonstrates how to set up basic authentication. An HTTP user agent uses basic authentication to provide a user name and password when making a request. For example, you send a request to the Github API for user information. The Github API accepts requests for user information on port 443 to https://api.github.com/user.
-
In a new project, set up an HTTP Listener operation to start an app from a browser.
-
Click + to add another component to the flow, and select HTTP Request.
-
In HTTP Request, click Edit. Set up the request configuration:
-
Accept the default configuration name HTTP Request.
-
In Protocol, select HTTPS.
-
Set the host to api.github.com.
-
Set the port to 443.
-
Accept the other defaults. Do not set the Base Path in URL Configuration.
-
-
Click Authentication and do the following things:
-
Select Basic Authentication.
-
Check Preemptive
-
In Username, type your Github user name.
-
In Password, type either your Github password or a personal access token.
-
Save.
-
-
In Path or URL, type /user and in Method, select GET.
-
Click Deploy, and the execute the flow:
-
Click Copy Link.
-
Paste the link in a browser or client, and type /trigger at the end.
The github information appears in the browser.
-
-
In HTTP Request > Output, in Show, select Payload.
The github information also appears correctly formatted.
{ "login": "max", "id": 16xxx11, "avatar_url": "https://avatars0.githubusercontent.com/u/16125343?v=3", "gravatar_id": "", ... "collaborators": 0, "private_repos": 0 } }