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.
Related
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.
curl --request POST
'https://storage.googleapis.com/storage/v1/b?project=&key=[YOUR_API_KEY]'
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]'
--header 'Accept: application/json'
--header 'Content-Type: application/json'
--data '{"name":""}'
--compressed
Error Message:
{
"error": {
"code": 400,
"message": "CORS request contains X-Origin header",
"errors": [
{
"message": "CORS request contains X-Origin header",
"domain": "global",
"reason": "corsRequestWithXOrigin"
}
]
}
}
If you use an access token, you can remove your API key. I personally follow the documentation and perform this requets, and it worked
curl --request POST 'https://storage.googleapis.com/storage/v1/b?project=[YOUR_PROJECT_ID]' \
--header "Authorization: Bearer [YOUR_ACCESS_TOKEN]" \
--header 'Accept: application/json' --header 'Content-Type: application/json' \
--data '{"name":"[MY_BUCKET_NAME]"}' --compressed
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"
}
}'
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"
}
}'
This call:
curl -X POST \
-H "Authorization: key=AAAAx4uYEXU:...e8EEq9aCv-pGWXIfyCp_lUp28mY" \
-H "Content-Type: application/json" \
-d '{ "data": {
"score": "5x1",
"time": "15:10"
},
"condition": "'dogs' in topics || 'cats' in topics",
"content_available": true
}' \
"https://fcm.googleapis.com/fcm/send"
Causes this error:
Invalid "condition" field: only support 'topics' conditions
I copied the condition field straight from the documentation... how can I get this to work?