-
Notifications
You must be signed in to change notification settings - Fork 1
Accessing Admin Login and API Keys
anishapai edited this page May 2, 2021
·
2 revisions
- Click the
Collectionsmenu on the left sidebar. - Navigate to
PhotoServer/Auth/Create Admin Account. - You should see a
POSTrequest tohttp://localhost:5000/auth/create_admin_account. - Click
Send. - In the bottom section, under
Body, you should see the following:
{
"status": "success",
"detail": "Admin account has been created.",
"account": "Username: \"admin\", Password: \"password\""
}
You have created the admin account! You can now login directly in the web-app client, or follow the steps below to create an API key.
- Click the
Collectionsmenu on the left sidebar. - Navigate to
PhotoServer/Auth/Login. - You should see a
POSTrequest tolocalhost:5000/auth/loginwhich may or may not have text following this. - Just under that, click
Bodyto edit the Body of the Post Request. - Replace
jdoe1withadmin. - Replace
secretwithpassword. - Click
Send. - In the bottom section, under
Body, you should see the following, with<some_token>replaced with an alphanumeric string.
{
"status": "success",
"detail": "Successfully Logged In.",
"access_token": "<some_token>",
"token_type": "bearer"
}
You have successfully logged in! Keep the response for step 4 below.
- After logging in, highlight the alphanumeric string
<some_token>in theBodyof your response. - Right click the highlighted token so a menu appears.
- In the menu, click on
Set: Globals > auth_token.
You have set the auth_token global variable! You can now create api keys for the train microservices. Note: The need for API Keys may soon be removed.
You can choose between predict or train in step 6
- Click the
Collectionsmenu on the left sidebar - Navigate to
PhotoServer/API/Create API Key - You should see a
POSTrequest tolocalhost:5000/auth/keywhich may or may not have text following this. - Just under that, stay on
Paramsto edit the Params of the Post Request - Replace
jdoe1withadmin - Replace
dataset_microservicewithtrain_microserviceto specify the value of theservicekey. - Replace
Testing Dataset Keywith any text you would like to provide detail. - Click
Send. - In the bottom section, under
Body, you should see the following, with<api_key>replaced with an alphanumeric string.
{
"status": "success",
"key": "<api_key>",
"type": "train_microservice",
"user": "admin",
"detail": "Testing Dataset Key",
"enabled": true
}
You have successfully accessed the train api key! Copy <api_key> to paste wherever it is needed in the app.