Foursquare callback error Uncaught exception - exception

I use foursquare API in an application. I have no issues when I run the app on my local machine but on a server I get this error after the user allows the app and is redirected to the callback url.
Fatal error: Uncaught exception 'EpiFoursquareException'
in /home/content/40/9029540/html/earlybirds/test/lib/EpiFoursquare.php:252
Stack trace:
#0 /home/content/40/9029540/html/earlybirds/test/lib/EpiFoursquare.php(208): EpiFoursquareException::raise(Object(EpiCurlManager), false)
#1 /home/content/40/9029540/html/earlybirds/test/lib/EpiFoursquare.php(196): EpiFoursquareJson->__get('response')
#2 /home/content/40/9029540/html/earlybirds/test/callback.php(45): EpiFoursquareJson->offsetGet('access_token')
#3 {main} thrown in /home/content/40/9029540/html/earlybirds/test/lib/EpiFoursquare.php on line 252
Anyone knows the reason?
I use PHP and mysql

Make sure you send the redirect_uri param when building your auth url and that it matches the one on the APP details page. I had to make two apps, one for testing locally and one for testing on my dev server which had, of course, a different URL.

Related

OCI SDK For DotNet Hangs When Doing Requests

I followed the example in described by Oracle here: https://docs.oracle.com/en-us/iaas/tools/dot-net-examples/51.3.0/vault/ListSecrets.cs.html and when I try any of the commands it sends a request and receives a response back with a response code of 200, but it does nothing after receiving a response. It just hangs. And I also only have 1 Vault and 1 Secret in that Vault. The logs stop with the log:
Setting Property Value from Header
Has any experienced this issue before?
I tried checking if it was the authentication, tried googling and tried other services like the KMSVaultService. I am expecting to get a value back when I call the ListSecrets method and for it not to hang.
The solution was to update the dependency packages. After doing that it started to work again

Getting OAuth Refresh Token Error UNAUTHORISED ERROR when hitting Bigtable

I have an app that uses Bigtable-hbase api for creating an Bigtable Connection using Service Account File.
This works fine in the local and sometimes on weblogic server also.
But after some request through the api , I am getting the following error -
io.grpc.StatusRuntimeException: UNAUTHENTICATED: Unexpected failure get auth token at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:981)
at com.google.auth.oauth2.ServiceAccountCredentials.refreshAccessToken(ServiceAccountCredentials.java:365)
at com.google.cloud.bigtable.grpc.io.RefreshingOAuth2CredentialsInterceptor.refreshCredentials(RefreshingOAuth2CredentialsInterceptor.java:379)
at com.google.cloud.bigtable.grpc.io.RefreshingOAuth2CredentialsInterceptor.access$100(RefreshingOAuth2CredentialsInterceptor.java:60)
at com.google.cloud.bigtable.grpc.io.RefreshingOAuth2CredentialsInterceptor$2.call(RefreshingOAuth2CredentialsInterceptor.java:328)
at com.google.cloud.bigtable.grpc.io.RefreshingOAuth2CredentialsInterceptor$2.call(RefreshingOAuth2CredentialsInterceptor.java:325)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)>
I am using following configuration to create the connection -
Configuration config = BigtableConfiguration.configure(projectId,instanceId);
config.set(BigtableOptionsFactory.BIGTABLE_SERVICE_ACCOUNT_JSON_KEYFILE_LOCATION_KEY, new File(filePath).toString());
Connection btConnection=ConnectionFactory.createConnection(config);
//then the code to read and write into the table`...
These code works fine sometimes and after some request it is throwing the above error.
I need to reason why it is happening and how can I resolve it so that application works fine when we sent the bulk request.
I think issue might be access refresh token , but how can I solve it?

Error 403: Required 'compute.zones.get' permission for a terraformproject

J added all the roles.I still cannot get terraform to build the project.
googlecompute: Error creating instance: googleapi: Error 403: Required 'compute.zones.get' permission for 'pr
ojects/terraform-3/zones/us-central1', forbidden Build 'googlecompute'
errored: Error creating instance: googleapi: Error 403: Required
'compute.zones.get' permis sion for
'projects/terraform-3/zones/us-central1', forbidden
This sort of issue might arise if somehow your cloudservices robot gets removed as a project editor. My best guess is that in your case this is the issue.
This might happen due to API call which has SetIamPolicy that is missing cloudservices robot from the "roles/editor" bindings. SetIamPolicy is a straight PUT, it will override with whatever policy is provided in the request. You can get the list of IAM policies for your project with below command as given in this article.
gcloud projects get-iam-policy [project-id]
From the list, you can check whether below service account has the editor permission or not.
To fix the issue, you can grant the mentioned service account "Editor" permission and check whether that solves the issue or not.
[id]#cloudservices.gserviceaccount.com

Heroku app: Error during WebSocket handshake: Unexpected response code: 200

I followed a tutorial on how to make a multiplayer tetris game, here is the repo:
https://github.com/Leftier/tetris
It worked just fine on localhost so I tried to deploy it in heroku (https://tetrixtest.herokuapp.com/ --ASD to move Q/E to rotate) but I get the following error:
WebSocket connection to 'wss://tetrixtest.herokuapp.com/' failed: Error during WebSocket handshake: Unexpected response code: 200
while trying to create the webSocket in this line (connection-manager.js line 14):
this.conn = new WebSocket(`wss://${window.location.hostname}:${window.location.port}`)
I don't know much about webSockets,
at first I thought that heroku was not able to handle websockets but that wasn't the case so I tried using the link directly as an argument instead of reading it from the browser but still the same issue.
I would like some clues/hints about why does this happens, I searched in google and github, but I only found issues related to socket.io
For me the solution was to turn on "Session affinity" by running this command heroku features:enable http-session-affinity
More info at https://devcenter.heroku.com/articles/session-affinity
Session affinity, sometimes referred to as sticky sessions, is a
platform feature that associates all HTTP requests coming from an
end-user with a single application instance (web dyno).

as3-websocket-server with https connections

I downloaded the library as3-websocket-server for a desktop AIR app and it works fine on Chrome.
When I use Firefox it is ok for HTTP pages, while I get an error message if I test it on HTTPS pages:
SecurityError: The operation is insecure."
I read that I should use wss:// rather than ws://, but the AIR server doesn't work with this protocol.
I tried to convert all "Socket" to "SecureSocket" in the Air App but I get an error:
1118: Implicit coercion of a value with static type flash.net:Socket
to a possibly unrelated type flash.net:SecureSocket
Any idea on how to have the server available for both protocols? On the client side I could just check if I'm on HTTP or HTTPS and call the right websocket.
Thanks