AERPAW-Platform-Control / aerpaw-portal

AERPAW Portal v2
0 stars 2 forks source link

API endpoint /users #1

Open mjstealey opened 2 years ago

mjstealey commented 2 years ago

/users

Endpoints

Functions

Fields

--- /users
display_name:           - string
email:                  - string
user_id:                - int
username:               - string
--- /users/{int:pk}
aerpaw_roles:           - array of string
display_name:           - string
email:                  - string
is_active:              - boolean
oidc_claim:             - string
user_id:                - int
username:               - string
--- /users/{int:pk}/credentials
name:                   - string
public_key_credential:  - string
public_key_id:          - int
--- /users/{int:pk}/tokens
access_token:           - string
refresh_token:          - string

Notes

Roles:

sschaud2 commented 2 years ago

@mjstealey Hi Michael, I'm trying to refresh the token and using the API mentioned on API Endpoint page ("http://aerpaw-dev.renci.org:8000/api/users/$userID/token/refresh") We are seeing the following response from this API. image Can you please check the response?

mjstealey commented 2 years ago

Can you please check the response?

Add a trailing slash to the API_URL, e.g. http://aerpaw-dev.renci.org:8000/api/token/refresh/

sschaud2 commented 2 years ago

Hi, I used a trailing slash too. But it gives me the same error. Following is my command: curl -X "POST" -H "Authorization: Bearer ${token}" -H "Content-Type: application/json" -d "${updatedtoken}" "http://aerpaw-dev.renci.org:8000/api/users/$userID/token/refresh/"

sschaud2 commented 2 years ago

image

mjstealey commented 2 years ago

I used a trailing slash too. But it gives me the same error.

Sorry, use http://aerpaw-dev.renci.org:8000/api/token/refresh/, without the /users/{int:pk} part

sschaud2 commented 2 years ago

It worked! Thanks

mjstealey commented 2 years ago

It worked! Thanks

Glad to hear it NOTE: The newly issued ACCESS_TOKEN is only seen by the receiver and is not currently stored to the User's profile - this will be taken care of when I migrate the refresh call to be under the /users endpoint (again, sorry about the confusion here)

sschaud2 commented 2 years ago

No problem and thanks for mentioning it.