I am having an issue sending requests from our PHP application to the OneDrive SDK.
I am using the following package to integrate our application with OneDrive:
https://github.com/krizalys/onedrive-php-sdk
It has been working perfectly fine for months then all of a sudden this morning it started responding with an SSL error:
SSL read: error:00000000:lib(0):func(0):reason(0), errno 104
I have tried to fix it all sorts of ways:
Updating all the dependencies within composer
Updating curl, openssl and php7.0-curl on the server (was already latest versions)
Creating a new OneDrive account to test to see if the problem persists (which is does)
When I created a new OneDrive account, the demo that is available through the GitHub package I linked earlier worked, but as soon as I started sending requests from our application it is now returning the same error as above.
I have been checking the status of OneDrive through various websites and social media but nothing has caught my attention with relation to the problem I am having.
We are using a basic Microsoft account, not a business one, I am not sure if maybe Microsoft has cottoned on to us using their SDK for business purposes and maybe blocked our application from sending requests, but I am unable to find any documentation online that relates to business vs non business SDK usage.
I have also been trying to find a support/contact page so I could contact Microsoft to confirm my theory above but I was unable to, so I am here hoping that my question could be answered.
Any help would be greatly appreciated.
Related
Good Afternoon,
I have an application and we're trying to connect to out IMAP server using Chilkat (PHP Extension), via the Client Credential Flow method, since it's supposed to be a server-to-server connection, without user interaction.
We're using the Microsoft Graph example as a base-code (https://www.example-code.com/phpExt/microsoft_graph_client_credentials.asp), but we're using the scope (https://ps.outlook.com/.default), link and API permissions as described in the Microsoft Documentation (https://learn.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth#use-client-credentials-grant-flow-to-authenticate-imap-and-pop-connections).
I'm able to generate the Access Token, but when we try to connect to an authorized mailbox, we are greeted with the following error message:
ChilkatLog:
Login:
DllDate: Jan 31 2021
ChilkatVersion: 9.5.0.85
UnlockPrefix: OUR_UNLOCK_CODE_HERE
Architecture: Little Endian; 64-bit
Language: Linux PHP
VerboseLogging: 0
loginX:
greeting: * OK The Microsoft Exchange IMAP4 service is ready. [SOME_CK_GENERATED_CODE_HERE]
authenticateXOAuth2:
xoauth2Imap:
ConnectionType: SSL/TLS
--xoauth2Imap
isOK:
serverResponse: aaab NO AUTHENTICATE failed.
--isOK
--authenticateXOAuth2
--loginX
Failed.
--Login
--ChilkatLog
I have tried using the token generated via postman, I've tried every single API permission that I found out on the Microsoft Documentation, and I have tried many different chilkat implementations on my server... All to no avail.
All I need is some way to connect to my IMAP folders, since we are currently using basic Auth (and basic Auth for IMAP will die at the end of the year).
I'm not sure what the problem is, since we gave our test email IMAP parmissions and followed to the letter the microsoft documentation. I'm a little lost on what could be causing the error, the API permissions, the mailbox permissions or our Chilkat PHP implementation. Can you guys help me find out what is going on, please? Thanks!
I feel your pain because I haven't been able to get client_credentials working with Office365 either.
It's a common use case, and you'd think Microsoft would make it easy.
My only suggestion (for now) is to get the very first OAuth2 access token using authorization flow (i.e. interactively with a browser), and then refresh non-interactively as needed from that point forward.
The blog post is a good starting point for using Chilkat with Office365 OAuth2:
https://cknotes.com/office365-modern-authentication-for-imap-pop3-and-smtp/
I am new to GoogleAPIs and Laravel, I run a PHP web application on Laravel 8 in a virtual Linux environment. Socialite and Drive API was working fine and out of sudden it doesn't work anymore and always return connection refused error after long period of loading as follows:
GuzzleHttp\Exception\ConnectException
Connection refused for URI https://www.googleapis.com/oauth2/v4/token
I had tried to create a new credential with new refresh token and checked all the network settings, and always clear config cache and restart apache for all troubleshoots I have tested, yet the error still exists.
I would appreciate it much if anyone could enlighten me on what are the aspects I shall look into it.
There are multiple issues in this question.
First and foremost, you are sending your secret to a third party. This means that they are able to do any API calls as you (using your name and quotas). Even if they claim that they won't, they can. Please remove any secret you may have and create new ones.
As for the OAuth 2.0, you seem to be using an old URL. You should probably take a look into the official documentation for:
Using OAuth 2.0 to Access Google APIs for a basic explanation.
Using OAuth 2.0 for Web Server Applications for making a web and getting permissions to get/modify a user's data (can be yourself).
Using OAuth 2.0 for Server to Server Applications for using a service account to execute as one of the users on your organization, without the need of manually giving permission.
Also notice that there are PHP libraries officially supported by Google to make your life way easier. See the Drive API's PHP Quickstart.
Hello to all
I am new in Amazon Alexa, I have a work to Alexa Skill account linking using PHP with oauth 2.0.
I have successfully configured all and also get code for Auth Code Grant but when I run my code in Chrome Browser it is generating Account linking Failed issue but when I run same URL in Firefox it generates Amazon linking failed with ERROR=missing-state.
Please help me to resolve my issue, any help would be highly appreciated.
Implementing Account Linking is tricky at times. The thing is at some point what happens between Alexa and the OAuth2 server is transparent for the Skill (Lambda), for example the process of refreshing a token among others, that is why I suggest you take a look at the references cited below.
Also because of the error shown, it seems that the parameter code is missing in one of the URLs exchanged back and forth between either the Alexa web console or Alexa mobile app and the OAuth2 server. Please verify it is always the same and is always present in the URLs. Implementing a proxy for sure will help on debugging this issue.
I would suggest you take a look at these great sources:
Debugging Account Linking
Using API Gateway to Debug Account Linking issues
I hope this helps somehow.
Cheers
Until recently we have been using the old gapi php class to extract Google Analytics data from a variety of sites that we manage.
In a nutshell at night the sites download the Analytics data and stores it locally. Until recently it worked beautifully but all of a sudden we started receiving all sorts of weird errors like CaptchaRequired.
Anyway I've done some reading and got the impression that it was time we move to the new Google APIs platform and while I have tried to follow the HelloAnalyticsAPI tutorial we initially got a 403 error but now after leaving it for a while when I try and run the app I get redirected to Google to login.
I just don't seem to be able to get my head around it. We need to completely automate this process so redirecting to login on the Google site isn't going to cut it.
Can anyone help? Anyone seen these issues?
Use google api client for php, it's easy
http://code.google.com/p/google-api-php-client/
And dev guide for analytics (V3):
https://developers.google.com/analytics/devguides/config/mgmt/v3/
Google sends Captcha responses if they are unsure about the authenticity of the request. This can be caused by multiple requests from the same IP for various different accounts, use of the ClientLogin authentication mechanism, and even weak passwords on the account you are logging in to.
To prevent them, I would recommend using OAuth 2.0 for the authentication - there are other security benefits to using this too.
I want oAuth verification process for a mobile application.For that i need to setup an oAuth server which listens to the requests and grant the access tokens.How do i set this up?I didnt found any relevant help on net.Please let me know.Also it will be good if it could be done using CakePHP
Regards
Himanshu Sharma
You would need an OAuth library for PHP that implements an OAuth service provider.
There are PECL and PEAR OAuth libraries, but my personal testimony is oauth-php as its simpler. I implemented both a server and client with it.
I cant comment on writing a service provider in Cake.
Updates based on OP's comments
Copy that directory to your PHP application to "install" it. You would need only CURL support from your host. There are no other prerequisites from the part of your host.
I did these steps to write an OAuth provider with oauth-php, do try these, google it and ask new questions when you get stuck.
read illustrated guides on how OAuth works
Studied relevant chapters from http://oauth.net/core/1.0a/ (try this order: 3,4, appendix,6 and 7 to start with)
read the example files included with the library, and see the how-tos in site's pages
hack those files and build it up your application