Retrieve Access Token for Quire API - unsupported_grant_type - quire-api

I am attempting to Retrieve Access Token following the directions in the api docs (https://quire.io/dev/api/)
Example curl request
curl -H "Content-Type: application/json" -X POST -d '{"grant_type":"authorization_code","code":"my_code","client_id":"my_client_id","client_secret":"my_client_secret"}' https://quire.io/oauth/token
I only receive this response:
{"error":"unsupported_grant_type","error_description":"The supported grant types are 'authorization_code', 'refresh_token'."}
Can you see anything wrong with my curl request?
by Anderson Reinkordt

sounds like a duplicate of: Exchange Quire authorization code for access token with GM_xmlhttpRequest
Explained/accepted in this response: https://stackoverflow.com/a/58370352/4740707
Since the error message is a bit misleading please vote for:
https://github.com/quire-api/quire-api/issues/9

Related

User signup feathers-authentication with passport-facebook-token

I am trying to allow users to sign up for my service via "login with facebook".
I have already done arrow 1-2. I need to do arrows 3-6. I have made a minimal Feathersjs example at https://github.com/morenoh149/feathers-chat-facebook-signup-api
I seem to be having trouble getting feathers-authentication and passport-facebook-token to generate the User object and sign them up. I've reviewed passport-facebook-token carefully. This answer explains that in the callback to passport-facebook-token you should create the User object. How do I do this with feathers-authentication?
When I provide the token in the body
curl localhost:3030/authentication \
--data-binary '{\
"strategy": "facebook-token", \
"access_token": "<phone token>" \
}'
I get
{"name":"NotAuthenticated",
"message":"You should provide access_token","code":401,
"className":"not-authenticated",
"data":{"message":"You should provide access_token"}
when I pass the token as a header
curl localhost:3030/authentication \
-X POST \
-H "Authorization: Bearer <access token>"
I get error
{"name":"GeneralError",
"message":"Cannot read property 'toLowerCase' of undefined",
"code":500,"className":"general-error","data":{},"errors":{}}
So I downloaded and ran the repo, I used VSCode to run the app and set break points. I created a breakpoint in the before create hooks on users.
The issue here is that the gravatar hook is expected the email to be context.data but it is in fact embedded within the facebook response. You will need to look at extracting the email from that data so that you can create a gravatar or just remove the gravatar hook altogether.

401 Unauthorized when trying to grab playlists using Spotify API

I've pulled a client_credentials token and while I can access other parts of the API, I can't seem to pull playlist information. It's definitely a public playlist, yet I'm getting 401 Unauthorized. Am I just misunderstanding something?
Edit
For example, this works:
puts curl -I -s -X GET "https://api.spotify.com/v1/users/#{testUser}" -H "Authorization: Bearer {#{#accessToken}}"
This does not:
puts curl -I -s -X GET "https://api.spotify.com/v1/users/#{testUser}/playlists/#{testPlaylist}?fields=href,name,owner(!href,external_urls),tracks.items(added_by.id,track(name,href,album(name,href)))" -H "Authorization: Bearer {#{#accessToken}}"
Are you sure you are sending the credentials cookie as part of your request? If you're not sure, you can use Wireshark or a similar tool to see the details of your request.
Edit: Relevant doc, but you've probably already seen this:
https://developer.spotify.com/web-api/get-playlist/

Azure: Parameter 'requestid' value is invalid

I'm trying to use the Microsoft Speech API as documented here: https://www.microsoft.com/cognitive-services/en-us/Speech-api/documentation/GetStarted/GetStarted-cURL
I have a key and I authenticate fine. When I try to use the service I get this error:
Parameter 'requestid' value '1234844532343434' is invalid.
I've tried different types of numbers and strings with no luck. What format is Azure looking for in requestid?
My test script looks like this:
token="..."
requestid="1234844532343434"
curl -v -X POST "https://speech.platform.bing.com/recognize?scenarios=smd&appid=D4D52672-91D7-4C74-8AD8-42B1D98141A5&locale=your_locale&device.os=your_device_os&version=3.0&format=json&instanceid=your_instance_id&requestid=${requestid}" -H "Authorization: Bearer ${token}" -H 'Content-type: audio/wav; codec="audio/pcm"; samplerate=16000' --data-binary #man1_nb.wav
Based on the documentation here, the requestid parameter's value should be a GUID.
Please try using that.

Format for PIN Code

In developing to the Nest Cloud API I've tested access using my developer pin code. The pin code is alpha-numeric and my question is:
During the authorization with the pin code, is the evaluation case insensitive or sensitive?
I.e. is 33HV7900 the same as 33hv7900?
Based on experimentation the :pin_code URL parameter in the CURL request below seems to produce an API access token regardless of case:
Request:
curl -X POST -H "Content-Type: application/json" 'https://api.home.nest.com/oauth2/access_token?client_id=:product_id&code=:pin_code&client_secret=:secret&grant_type=authorization_code'
Response:
{
"access_token": "my_token_here",
"expires_in": 315360000
}
I have obfuscated values in both the Request & Response.

Square Connect can't subscribe to webhook notifications

I am following the instructions here on setting up webhook notifications for Square payments. But when I execute the curl statement in step 5 to subscribe to my own merchant's payment notifications, I get the response:
{"type":"bad_request","message":"Request body is not an array of event types"}
The curl statement is
curl -X PUT -H "Authorization: Bearer MY_ACCESS_TOKEN" -d '{"event_types": ["PAYMENT_UPDATED"]}' https://connect.squareup.com/v1/me/webhooks
Did they update the event type names? I can't find any other documentation on webhooks.
Whoops! Thanks for catching this error in the blog post, which I have now corrected. The format of the curl previously shown in step 5 had two errors:
The request body should simply have been the array of desired event types, such as:
["PAYMENT_UPDATED"]
With no JSON object surrounding it. The correct format is also shown in the API documentation.
The request was missing a Content-Type: application/json header. All requests to Connect API endpoints require this header.
The correct request looks like this, with your personal access token substituted where indicated:
curl -X PUT -H "Authorization: Bearer PERSONAL_ACCESS_TOKEN" -H "Content-Type: application/json" -d "[\"PAYMENT_UPDATED\"]" https://connect.squareup.com/v1/me/webhooks

Resources