I can't disable the user with the Keyrock API - api

I want to disable or enable the user found in keyrock with API, but I can't. https://keyrock.docs.apiary.io/ doesn't say how to do it here. Isn't that possible?enter image description here

Log in as an admin user via the REST API.
curl -iX POST \
'http://localhost:3005/v1/auth/tokens' \
-H 'Content-Type: application/json' \
-d '{
"name": "admin#test.com",
"password": "1234"
}'
The response header returns an X-Subject-token Header which identifies who has logged on the application. This token is required in all subsequent requests to gain access.
The image you give in the question is just a GUI version of the GET /users endpoint
curl -L -X GET 'http://localhost:3005/v1/users' \
-H 'Content-Type: application/json' \
-H 'X-Auth-token: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'
Or you can request a specific user:
curl -L -X GET 'http://localhost:3005/v1/users/bbbbbbbb-good-0000-0000-000000000000' \
-H 'Content-Type: application/json' \
-H 'X-Auth-token: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'
Returns:
{
"user": {
"scope": [],
"id": "bbbbbbbb-good-0000-0000-000000000000",
"username": "bob",
"email": "bob-the-manager#test.com",
"enabled": true,
"admin": false,
"image": "default",
"gravatar": false,
"date_password": "2018-07-30T11:41:14.000Z",
"description": "Bob is the regional manager",
"website": null
}
}
You want to set enabled: false using the PATCH /user endpoint.
curl -L -X PATCH 'http://localhost:3005/v1/users/bbbbbbbb-good-0000-0000-000000000000' \
-H 'Content-Type: application/json' \
-H 'X-Auth-token: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' \
--data-raw '{
"user": {
"username": "bob",
"email": "bob-the-manager#test.com",
"enabled": false,
"gravatar": false,
"date_password": "2018-07-26T15:25:14.000Z"
}
}'
More information can be found within the Security Chapter Tutorials
within the FIWARE documentation where Keyrock is a component found within the FIWARE Catalogue
In the FIWARE documentation an example is given using Keyrock to provide user identities around a "powered by FIWARE" solution. Note that whilst Keyrock is commonly used in "powered by FIWARE" solutions (along with other elements from the FIWARE Catalogue), it could also be used to provide identities for other independent applications or micro-services - it is not tightly bound to only be used in FIWARE scenarios. Similarly alternative open-source or proprietary components for security or identity management systems could be used to secure "powered by FIWARE" solution as well.

Related

LinkedIn Article Post API giving 500 Internal Server Error

I'm trying to post an article on LinkedIn via their new Post API.
Below is my curl request. Which follows their documentation.
Problem: Randomly Article Post giving 500 Internal Server Error from LinkedIn
The image is uploaded via the Image API and urn works in an "image" post.
curl --location --request POST 'https://api.linkedin.com/rest/posts' \
--header 'Authorization: Bearer UserAccessToken' \
--header 'X-Restli-Protocol-Version: 2.0.0' \
--header 'LinkedIn-Version: 202208' \
--header 'Content-Type: application/json' \
--data-raw '{
"author": "urn:li:person:ownerid1234",
"commentary": "UnitTest ArticlePost with Latest API",
"visibility": "PUBLIC",
"distribution": {
"feedDistribution": "MAIN_FEED",
"targetEntities": [],
"thirdPartyDistributionChannels": []
},
"content": {
"article": {
"source": "https://shorturl.at/cfhL4",
"title": "Article Post",
"description": "",
"thumbnail": "urn:li:image:C5610AQE5yn7MbvKXow"
}
},
"lifecycleState": "PUBLISHED",
"isReshareDisabledByAuthor": false
}'

Authorization error in Onfido with same api token

I am using onfido v3.2 and I want to create SDK token. First I had create applicant using sandbox API key.
curl -X POST https://api.eu.onfido.com/v3.2/applicants/ \
-H 'Authorization: Token token=<YOUR_API_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"first_name": "Jane",
"last_name": "Doe"
}'
Then I had use applicant id from above api response for create SDK token and use same API token. https://documentation.onfido.com/#create-applicant
curl -X POST https://api.eu.onfido.com/v3.2/sdk_token \
-H 'Authorization: Token token=<YOUR_API_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"applicant_id": "<APPLICANT_ID>"
}'
I am using same API TOKEN in both api but sdk create api return error.
https://documentation.onfido.com/#generate-sdk-token
{
"error": {
"type": "authorization_error",
"message": "Authorization error: please re-check your credentials",
"fields": {}
}
}
I don't understand what going wrong here? Thank you in advance.

Cannot create new Pipeline using Az DevOps Pipelines API 6.0-preview.1

I'm trying to create new Pipelines using this API endpoint:
POST https://dev.azure.com/{organization}/{project}/_apis/pipelines?api-version=6.0-preview.1
This is the request I'm using:
curl -X POST \
'https://dev.azure.com/<myorg>/<myproj>/_apis/pipelines?api-version=6.0-preview.1' \
-H 'Authorization: Basic <b64string>' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
"configuration":{
"repository": {
"id": "<repo-guid>",
"name": "<repo-name>",
"type": "azureReposGit"
},
"path": "pipeline.yaml",
"type": "yaml"
},
"folder": "\\custompath\\",
"name": "<pipelinename>"
}
I keep getting the same error:
{
"$id": "1",
"innerException": null,
"message": "Value cannot be null.\r\nParameter name: repositoryName",
"typeName": "System.ArgumentNullException, mscorlib",
"typeKey": "ArgumentNullException",
"errorCode": 0,
"eventId": 0
}
It seems an issue with my payload, but documentation isn't very helpful about it
https://learn.microsoft.com/en-us/rest/api/azure/devops/pipelines/pipelines/create?view=azure-devops-rest-6.0
Current version o nodejs sdk doesn't support the Pipeline API yet. Can anyone help me?
I'm able to reproduce your issue on my side, and have reported this issue at website below:
https://developercommunity.visualstudio.com/content/problem/1101376/create-pipeline-rest-api-does-not-work.html
Product team has provided response that "A fix for this issue has been prepared. It should be released to everyone within the next 3 weeks."

Creating a tag with the Bitbucket Server API fails

I'm trying to use the Bitbucket Server RST API to create a new tag for a specific commit (represented by a hash). Please note that I use basic auth but don't write it to my examples below. What I've got is an HTTP 500 response.
curl -XPOST 'http://<server>/rest/api/latest/projects/p1/repos/r1/tags' -d '{
   "name": "my-new-tag",
    "hash": "0d2019c8e18f8c961cdb67cb27afb69b04f3a10b"
}'
I also tried:
curl -XPOST 'http://<server>/2.0/repositories/username/r1/refs/tags' -d '{
   "name": "my-new-tag",
    "hash": "0d2019c8e18f8c961cdb67cb27afb69b04f3a10b"
}'
But in this case the request ends up in an HTTP 404 and I think that's because this is not a Bitbucket Server URL.
You can try this way:
curl -X POST -k -H 'Content-Type: application/json' -s -u <Your Account>:<Your password> -i 'https://api.bitbucket.org/2.0/repositories/username/r1/refs/tags' --data '{
"name": "my-new-tag",
"target":{
"hash": "0d2019c8e18f8c961cdb67cb27afb69b04f3a10b"
}
}'
or
curl -X POST -k -H 'Content-Type: application/json' Authorization: Basic <<Authentication String>>' -i 'https://api.bitbucket.org/2.0/repositories/username/r1/refs/tags' --data '{
"name": "my-new-tag",
"target":{
"hash": "0d2019c8e18f8c961cdb67cb27afb69b04f3a10b"
}
}'

How to add credentials username and password using an curl api or REST API or crumbissuer in jenkins?

Jenkins is using nginx reverse-proxy.I need to add credentials username and password not by manual steps i.e;jenkins-->manage jenkins-->credentials --->domain--->global-->username&password but by curl api. Currently I 'm trying with this Trying this curl command inside the pod.
CRUMB=$(curl -s -u USERNAME:PASSWORD 'http://ELB-LINK-elb.amazonaws.com/jenkinscore/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)') &&
curl -H $CRUMB -X POST -u USERNAME:PASSWORD 'https://ELB-LINK-elb.amazonaws.com/jenkinscore/credentials/store/system/domain/_/createCredentials' \
--data-urlencode 'json={
"": "0",
"credentials": {
"scope": "GLOBAL",
"id": "identity",
"username": "USER",
"password": "PASS",
"description": "CRED",
"$class": "com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl"
}
}'