-
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
Collections
menu on the left sidebar. - Navigate to
PhotoServer/Auth/Create Admin Account
. - You should see a
POST
request 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
Collections
menu on the left sidebar. - Navigate to
PhotoServer/Auth/Login
. - You should see a
POST
request tolocalhost:5000/auth/login
which may or may not have text following this. - Just under that, click
Body
to edit the Body of the Post Request. - Replace
jdoe1
withadmin
. - Replace
secret
withpassword
. - 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 theBody
of 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
Collections
menu on the left sidebar - Navigate to
PhotoServer/API/Create API Key
- You should see a
POST
request tolocalhost:5000/auth/key
which may or may not have text following this. - Just under that, stay on
Params
to edit the Params of the Post Request - Replace
jdoe1
withadmin
- Replace
dataset_microservice
withtrain_microservice
to specify the value of theservice
key. - Replace
Testing Dataset Key
with 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.