• Join - It's Free

POST... 403 Forbidden

Started by Shmuel-Aharon Kam (Kahn / שמואל-אהרן קם (קאן on Wednesday, February 12, 2025
Problem with this page?

Participants:

Related Projects:

Showing all 8 posts

In the ongoing saga of getting my post calls to work, they now produce 403 errors. I KNOW that it's a post being sent because I temporarily used http (and not https), and checked with Wireshark. Here's a log of my API calls. There are three standard GET calls before the post, as part of the test set-up. Let's hope the security filter will let me post this.

API GET : https://www.geni .com/platform/oauth/request_token?......................

API GET : https://www.geni .com/api/profile-53597431?fields=guid

API GET : https://www.geni .com/api/profile-34838408159?fields=guid

API POST: https://www.geni .com/api/profile-34838408159/update

I just ran it.

The security filter didn't like my posting the POST call values. I'll try a different way.

headers: Authorization, Content-type: and Accept: application/json
content {"about_me":"Yankee Dooble"}

Failed to open stream: HTTP request failed! HT TP/1.1 403 Forbidden

Shmuel-Aharon Kam (Kahn / שמואל-אהרן קם (קאן when you use the client_credentials flow, you're not authorizing as a user. You're using the site as a guest, which has no permission to update profiles. From https://oauth.net/2/grant-types/client-credentials/ :

The Client Credentials grant type is used by clients to obtain an access token outside of the context of a user.

I think you need to switch to one of the other flows that uses https://www.geni.com/platform/oauth/authorize to get an OAuth token that is bound to the permissions of the authorizing user.

OK. Thanks. I'll look into it. Back to the drawing board.

Shmuel - if you can do you API work as an app on your PC you should us the desktop login method.

Bjørn, at present it's a CLI script running from within the Eclipse IDE, because that was really all I needed. I guess I'll need to change that to a webpage run on my local Apache server.

The other major PITA is that I can't get PHPUnit to work properly. :-/

Showing all 8 posts

Create a free account or login to participate in this discussion