Failed to Test Access to Google Photo - android

After trying to read ALL the documentation about Google Photo API access ... I've failed.
Just testing web access with:
https://photoslibrary.googleapis.com/v1/mediaItems:search
It gave: error code: 401
"message": "API keys are not supported by this API. Expected OAuth2 access token or other authentication credentials that assert a principal. See https://cloud.google.com/docs/authentication"
I tried using the client ID (xxxxxxx) generated with this request:
https://photoslibrary.googleapis.com/v1/mediaItems:search?client_id=xxxxxxx
Besides "client_id" I tried "key" with no luck.
What is the API REST format for "Expected OAuth2 access token"
Thanks!!

Related

Alexa app to app account linking in android app , Skill Activation Api gives error

here is the link
https://developer.amazon.com/en-US/docs/alexa/account-linking/app-to-app-account-linking-starting-from-your-app.html
Steps that I followed in my Android App.
I completed the LWA fallback url setup , in fallback URL I have used client ID that is received from Account linking page of Alexa custom skill.
After open the LWA url in browser , page asked to Login in Amazon after that I can see the page where my skill asked to access the lwa details with an Allow and Cancel button
After Allow My Application is getting Auth-Token , From that Auth-Token I am calling token API and getting Access Token.
after that I am calling below activation skill api
POST /v1/users/~current/skills/{skillId}/enablement HTTP/1.1
Host: api.amazonalexa.com, api.eu.amazonalexa.com,
api.fe.amazonalexa.com
Content-Type: application/json
Authorization: "Bearer {Amazon Access Token}"
{
"stage": "skill stage",
"accountLinkRequest": {
"redirectUri": "https://yourRedirectURI",
"authCode": "Your user's authorization code from your authorization
server",
"type": "AUTH_CODE"
}
}
I have used parameters values like below
Amazon access token - Got that from Amazon token API.
redirectUri = https://pitangui.amazon.com/api/skill/link/XXXXXXXXXXX
authCode = got after perform successful login with amazon.
But I got 400 bad request error with Message
{"message":"Invalid account linking credentials"}
I am not able to get what I am doing wrong . Help me out if anyone have some suggestions.
The 400 bad request "Invalid account linking credentials" it's because you are receiving wrong credentials, so make sure that you are using correct client ID and secret to use skill Activation API.
I would recommend following this article.
https://amazon.developer.forums.answerhub.com/articles/240817/app-to-app-account-linking-debugging-tips.html

Huawei In App Purchase, implemented everything correctly but still getting the error : authorization format invalid

I am trying to implement Huawei in App Purchase kit to my application.
The request I am sending to the server is here:
request {"purchaseToken":"0000017343ec91821b076fd75f71103a5a85595d2dfd245d708fd6058e676f857792b83622c7fd51x434e.1.100059717","productId":"1007"}
I am following this guide here : https://developer.huawei.com/consumer/en/codelab/HMSInAppPurchase/index.html#0
I am following the same steps but
I am getting an error message from server which says :
result: {"responseCode":"6","subErrCode":"211","responseMessage":"6-211-authorization format invalid"}
Which part I might be doing wrong?
In the error you are getting, it says "authorization format invalid". This means your ignature verification data format is invalid. The possible errors might be :
The token in the request header is not encrypted in Base64 mode.
The character string APPAT is not appended before the access token for authorization. The correct access token is similar to APPAT:thisIsAppAtVaule.
for more information, please check : https://developer.huawei.com/consumer/en/doc/development/HMS-Guides/iap-FAQ
You are facing issue in server side. Kindly go through the given link to know more about In App Purchase server side and client side.
In-App Purchase Article Develioper Forum:
Client side : https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0201255229704010231&fid=0101187876626530001
Server side : https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0201273064244120101&fid=0101187876626530001
In-App Purchase Github Link :
Client side: https://github.com/DTSE-India-Community/HMS-In-App-Purchase-Kit
Server side:
https://github.com/DTSE-India-Community/Huawei-In-App-Purchase-And-Push-Kit-Server_Side-Implementation

How to send push notification via postman using AWS Pinpoint

I want to send push notifications to mobile apps using REST API provided by AWS. I read their documentation but i am getting an error unauthorized. Does any one able to send push notification using REST API ?
The following is an example of a REST request int the documentation
GET /v1/apps/a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6/campaigns
Accept: application/json
Authorization: AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20161127/us-
east-1/mobiletargeting/aws4_request, SignedHeaders=accept;host;x-amz-date,
Signature=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a1b2c3d4e5f6
Host: pinpoint.us-east-1.amazonaws.com
X-Amz-Date: 20161127T202324Z
Following is the error I am getting
The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details
Currently, if I specify my AWS AccessKey & SecretKey in the Postman Environment as per the Amazon Pinpoint tutorial with POSTMAN I also get the same error message : The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details..
To get this setup working, I have specified my AWS AccessKey & SecretKey in Postman Authorization tab as illustrated below :
Below is a screenshot of the push notification message received on my Android phone:

Firebase auth gives error when decoding ID token on backend for android but not for web

I am using firebase auth for authenticating users via facebook. I have a website and an android app. The ID token generated on the website is decoded and the auth data is retrieved without any problem. However, when decoding the ID token that is received from the android app, it gives an error:
errorInfo:
{
code: 'auth/argument-error',
message: 'Firebase ID token has invalid signature. See https://firebase.google.com/docs/auth/admin/verify-id-tokens
for details on how to retrieve an ID token.' },
codePrefix: 'auth'
}
I have no idea what I am doing wrong. Any help would be highly appreciated!
UPDATE: The error code 'auth/argument-error' is no where to be found in the official docs (here). Could this be an error caused due to different versions?

Twitter followers list not getting

I know twitter api update to 1.1 and i have get successfully token & tokenSecret
I have checked both api
https://api.twitter.com/1/friends/ids.json?cursor=-1&screen_name=myscreenname
response getting
{"errors": [{"message": "The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.", "code": 68}]}
https://api.twitter.com/1.1/friends/ids.json?cursor=-1&screen_name=myscreenname
response getting
{"errors":[{"message":"Bad Authentication data","code":215}]}
Please help me to get Response of Followers ids list.
Just tried to execute your request (https://api.twitter.com/1.1/friends/ids.json?cursor=-1&screen_name=myscreenname) in dev console and it works like a charm.
Seems like you've missed the authorization step (autorization with OAuth is required for api v1.1), so verify that you authorized with valid credentials.
You can read more about auth on twitter here or check out documentation for library that you are using to make api requests.

Categories

Resources