Piacasa Api error Invalid Token - php

Hi i am using Google Gdata Api in php. I am getting an error
"Error: Expected response code 200,
got 403 Token invalid - AuthSub token
has wrong scope".
What should i do. What's the solution.

You're likely using a wrong base url for your queries.
The correct base url for the Picasa Web Albums is http://picasaweb.google.com/data/

Related

Cannot obtain token...site not reachable

I'm using the sample code provided by DocuSign quickstarts. That code requires me to obtain an access token.
It says to visit the link below in order to obtain the token:
https://developers.hqtest.tst/oauth-token-generator
I get error message:
This site can’t be reached.
developers.hqtest.tst’s server IP address could not be found.
Very sorry, the url you have there is a test/internal url which should not have been published. If you can point me to where you found it - w'ell fix it.
The correct url for our token generator is: https://developers.docusign.com/oauth-token-generator

Yii2 OpenId Connect error - yii2-authclient returns 400 error "Token not provided" when I try to getUserAttributes()

I'm implementing OpenId Connect into my Yii2 app using the yii2-authclient library. I can login and exchange the code for a token with no problems. I've followed most of the code examples on the web and set a successCallback function that gets called once a user successfully logs in. It looks like this:
public function successCallback(ClientInterface $client)
{
$attributes = $client->getUserAttributes();
}
This code gets called, but calling getUserAttributes() results in the following error:
Exception – yii\authclient\InvalidResponseException
Request failed with code: 400, message:
{"error":"invalid_request","error_description":"Token not provided"}
The logs on the id server show a blank client and user, with an error of invalid_token.
I took a close look at the request I make and I see an access_token element. Any ideas what the problem might be? I can provide more information if necessary.
I figured it out. The problem was that the yii2-authclient library was sending the token as a GET parameter and the ID server was expecting it as a POST param. I upgraded the yii2-authclient library and that solved the problem since a recent change sends the parameter as POST instead of GET.

PP_E_RPS_CERT_NOT_FOUND error when querying Outlook API

I am trying to retrieve the contents of my calendar using the Outlook REST API, but I am getting weird error responses.
The code is based on the example code supplied by Microsoft in https://github.com/microsoftgraph/php-connect-rest-sample
I have created an application and specified it want access to calendar.read and changed the scope in the testcode, Constants::SCOPE, to include this scope.
After succesfully retrieving a token I can verify that the application requests and sets the correct privileges. After that I try to retrieve the events in my calendar as described at the documentation: https://msdn.microsoft.com/en-us/office/office365/api/calendar-rest-operations#get-series-master-and-single-events-rest
I use the Advanced REST client add-on for Chrome to create a GET request with the following specs:
Url: https://outlook.office.com/api/v2.0/me/events
Headers:
Authorization: Bearer [token]
Prefer: outlook.timezone=Europe/Berlin
The response I get is a 401 status code with the following content for the X-Ms-Diagnostics header:
2000010;reason="ErrorCode: 'PP_E_RPS_CERT_NOT_FOUND'. Message: 'Certificate cannot be found. Certificate required for the operation cannot be found.%0d%0a Internal error: spRPSTicket->ProcessToken failed. Failed to call CRPSDataCryptImpl::UnpackData:Certificate cannot be found. Certificate required for the operation cannot be found.%0d%0a Internal error: Failed to decrypt data. :Failed to get session key. RecipientId=293577. spCache->GetCacheItem returns error.:Cert Name: (null). SKI: d6c3dacffd2b3fba2fb3d6c2b0fcd78680a3acd1...'";error_category="invalid_msa_ticket"
The Www-Authenticate header specifies 'error="invalid_token"' while the token was just received.
Any idea what I am doing wrong?
I think another thing you might be able to check out is the scope when you request the v2 endpoint. for V2 endpoint, the scope is different between Graph API and outlook api. you need to specify scope as "https://outlook.office.com/calendars.read" instead of Graph scope.
I hope it will help.
Basically, the message means that the token you're trying to use is not valid for the operation.
I went through this. This is how I've solved:
I use the suggested scopes here (I was creating an event): https://msdn.microsoft.com/office/office365/APi/calendar-rest-operations#create-events
To get the authorization code I used this URL schema:
https://login.live.com/oauth20_authorize.srf?client_id=[YourClientID]&scope=[ScopeYouNeed]&response_type=code&redirect_uri=[YourRedirectURI]
Then I get the refresh & the access token. And now it's working!
You need to just change the URL from https://outlook.office.com/api/v2.0/me/events to https://graph.microsoft.com/v1.0/me/events

Request forbidden by administrative rules reddit api

I have a problem with api to reddit. I tried to use php sdk https://github.com/jcleblanc/reddit-php-sdk, but for each method from API, I receive message:
403 Request forbidden by administrative rules reddit. I think is i problem with access_token, but I used the one that the returned API. I tried with tutorial from https://www.reddit.com/r/redditdev/comments/197x36/using_oauth_to_send_valid_requests/c8lz57u, but in step 6 I get same error 403. I obtained the access_token in step 6.
Response in step 6 is:
{"access_token": "DhiI6vzq86UlCjTIl80u5pCEZ6A", "token_type": "bearer", "expires_in": 3600, "scope": "edit,flair,history,identity,modconfig,modflair,modlog,modposts,modwiki,mysubreddits,privatemessages,read,report,save,submit,subscribe,vote,wikiedit,wikiread"}
Authentication is ok, but I can not call any method from API.
Can someone help me with some advice?

Facebook Login with Codeigniter

I am trying to put Facebook Login button on Codeigniter platform.
I have followed this procedure
http://www.dannyherran.com/2011/02/facebook-php-sdk-and-codeigniter-for-basic-user-authentication/
but I got this error
API Error Code: 100
API Error Description: Invalid parameter
Error Message: Requires valid redirect URI.
I used exactly same code that the website provided.
Can you tell me why I get this error message?
Have you set valid redirect_uri ?
'redirect_uri' => ''

Categories