Changes with accounts.eclipse.org Profile API with Drupal 10 migration
Via https://gitlab.eclipse.org/eclipsefdn/it/websites/drupal/eclipsefdn/-/merge_requests/523, I am creating a custom Drupal Authentication provider that allows us to validate API requests using tokens from our Eclipse API private oAuth2 server.
This is introducing some small changes:
-
Both the account/profile (search) and account/profile/{name} will require an Access token. This is API is only ment to be used by the public profile API to fetch data that only exist in Drupal.
-
Access Denied Response (403):
curl -k -X GET "https://accounts.eclipse.dev.docker/account/profile/webmastersdfdsf"
-H "Authorization: Bearer xyz"
-H "Content-Type: application/json"
-H "Accept: application/json"{"status":"error","http_code":403,"error":"Forbidden","message":"Invalid authorization token."}
- User Not Found Response (404)
curl -k -X GET "https://accounts.eclipse.dev.docker/account/profile/webmastersdfdsf"
-H "Authorization: Bearer xyz"
-H "Content-Type: application/json"
-H "Accept: application/json"{"message":"User not found."}
- User Found (200)
curl -k -X GET "https://accounts.eclipse.dev.docker/account/profile/webdev"
-H "Authorization: Bearer xyz"
-H "Content-Type: application/json"
-H "Accept: application/json"
{
"uid": 9,
"name": "cguindon",
"picture": "https://accounts.eclipse.org/user/cguindon/picture",
"first_name": "Christopher",
"last_name": "Guindon",
"full_name": "Christopher Guindon",
"job_title": "Manager, Web Development",
"website": "http://www.chrisguindon.com/",
"country": {
"code": "CA",
"name": "Canada"
},
"bio": "Hello world! When I am not at a computer, which is rare, I spend my time playing the drums, watching hockey or at the top of a hill snowboarding. I am also very passionate about music and live concerts! ✈",
"org": "Eclipse Foundation",
"twitter_handle": "chrisguindon",
"mxid": "@chrisguindon:matrix.eclipse.org",
"github_handle": "chrisguindon",
"github_verified": true,
"interests": [
"Snowboarding",
"webdev",
"php",
"javascript",
"Hockey",
"docker"
]
}
//cc @epoirier