-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CORE-1027: added some endpoints to allow administrators to get impers…
…onation tokens
- Loading branch information
Showing
6 changed files
with
75 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
This service allows administrative users to obtain an impersonation token in order to act on behalf of another | ||
user. This feature is useful for troubleshooting in cases where a user is seeing a problem that the administrator can't | ||
reproduce. You must be logged in using HTTP basic authorization to use this endpoint. The token endpoints are the only | ||
endpoints that use basic authorization. To log in, click the Authorize button above, enter your username and password | ||
under `Basic authentication`, and click the Authorize button underneath the password text box. | ||
|
||
Once you have the access token, you can use it to authorize calls to other endpoints in the Swagger UI. First, remove | ||
the basic authentication credentials by clicking the Authorize button above and clicking the Logout button in the `Basic | ||
authenitcation` section of authorization window. Second, click the Authorization button again and type the word `Bearer` | ||
followed by a single space in the Value text box of the `Api key authorization` section of the window. Paste in the | ||
access token from this endpoint's response body then click the Authorize button underneath the Value text box. | ||
|
||
You can use `curl` and `jq`, which is available from [the jq web site](https://stedolan.github.io/jq/), to obtain an | ||
access token from the command line. The easiest way to do this on Unix-like operating systems is to define an | ||
environment variable containing the authorization header: | ||
|
||
``` | ||
export AUTH_HEADER=\"Authorization: Bearer $(curl -su username https://de.cyverse.org/terrain/admin/token?username=foo \ | ||
| jq -r .access_token)\" | ||
``` | ||
|
||
Once you have the authorization header stored in an environment variable, you can include it in calls to other Terrain | ||
endpoints: | ||
|
||
``` | ||
curl -sH \"$AUTH_HEADER\" \"https://de.cyverse.org/terrain/apps?search=word\" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters