[beta] SDK 2.0 with Namespaces and OAuth2 support!

Trackmania Forever public API and its open source PHP SDK.

Moderator: NADEO

calaagree
Posts: 152
Joined: 17 Jun 2011, 13:14

Re: [beta] SDK 2.0 with Namespaces and OAuth2 support!

Post by calaagree » 23 Jul 2011, 06:36

I have the same problem.

I have the error something went wrong.
I tried with my api: tmf_calaagree_2
And tried to connect with my account.

I think it's again the url but i'm not sure.

User avatar
gouxim
Nadeo
Nadeo
Posts: 1154
Joined: 14 Jun 2010, 17:20

Re: [beta] SDK 2.0 with Namespaces and OAuth2 support!

Post by gouxim » 23 Jul 2011, 13:48

calaagree wrote:I have the same problem.

I have the error something went wrong.
I tried with my api: tmf_calaagree_2
And tried to connect with my account.

I think it's again the url but i'm not sure.
The error is "redirect_uri_mismatch". You registered a URI with www.*** and here you are using ***.

I'll update the error handling to you have better error messages.
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)

calaagree
Posts: 152
Joined: 17 Jun 2011, 13:14

Re: [beta] SDK 2.0 with Namespaces and OAuth2 support!

Post by calaagree » 23 Jul 2011, 14:37

Ok, does www.****.com is included in *****.com ? (in order to avoid the problem).

User avatar
gouxim
Nadeo
Nadeo
Posts: 1154
Joined: 14 Jun 2010, 17:20

Re: [beta] SDK 2.0 with Namespaces and OAuth2 support!

Post by gouxim » 23 Jul 2011, 14:48

Nop, for now it's only per domain (www.blabla & blabla are different domains)
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)

calaagree
Posts: 152
Joined: 17 Jun 2011, 13:14

Re: [beta] SDK 2.0 with Namespaces and OAuth2 support!

Post by calaagree » 23 Jul 2011, 14:55

Ok i'll redirect' *****.to http://www.*****

Bit for now i still have some problems, i get an error 400 when i try to retriev the player infos:
$player = $trackmania->getPlayer(); -> int(400) string(11) "Bad Request" string(0) ""
Did i made a mistake ?

User avatar
gouxim
Nadeo
Nadeo
Posts: 1154
Joined: 14 Jun 2010, 17:20

Re: [beta] SDK 2.0 with Namespaces and OAuth2 support!

Post by gouxim » 25 Jul 2011, 10:09

calaagree wrote:Ok i'll redirect' *****.to http://www.*****

Bit for now i still have some problems, i get an error 400 when i try to retriev the player infos:
$player = $trackmania->getPlayer(); -> int(400) string(11) "Bad Request" string(0) ""
Did i made a mistake ?
Do you still have the error? If so, can you give me the time so I know "when" to check in the error logs?
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)

calaagree
Posts: 152
Joined: 17 Jun 2011, 13:14

Re: [beta] SDK 2.0 with Namespaces and OAuth2 support!

Post by calaagree » 25 Jul 2011, 12:07

I've just tried and now i got an error with code 0.
Dunno why it does this.

The dump is : int(0) NULL string(0) ""

User avatar
m4rcel
Posts: 653
Joined: 15 Jun 2010, 11:12
Contact:

Re: [beta] SDK 2.0 with Namespaces and OAuth2 support!

Post by m4rcel » 25 Jul 2011, 12:51

I now tried myself to acces the private data of a user, and I only get an Error 400 Bad Request when calling Player->getPlayer(), after I allowed Access to my account's data. (Before allowing the access, this method returned false, as expected.)

When trying to call Player->getBuddies(), Player->getEmail() or Player->isOnline(), I always get 401 Not Authorized, although I allowed access to these data.

(Both features have been tested with a self written script, running on my localhost, using a normal WebBrowser (not in a ManiaLink))

Furthermore, I noticed, that the detailled error message is no longer placed into the Exception. With SDK 1.0, I got the message with $e->getMessage(), but this field seems to be always empty in SDK 2.0. (For example, I accidently called Players->getMultiplayerRankingForEnvironment with "island". In the old SDK, it said, that "island" is not known, the new SDK only throws the 400 Bad Request.)


Another thing, not directly related with the SDK but maybe with the problem, is that the ManiaPlanet-forum is redirecting to the TMF Playerpage when clicking this "TrackMania Link Account" button in the profile settings, and not to this Allow-Access-page as before. (So you have no chance to change the displayed information atm.)
ImageImage
Image

User avatar
gouxim
Nadeo
Nadeo
Posts: 1154
Joined: 14 Jun 2010, 17:20

Re: [beta] SDK 2.0 with Namespaces and OAuth2 support!

Post by gouxim » 25 Jul 2011, 16:56

Thank you all for the reports, it helps debugging ;)
m4rcel wrote:I noticed, that the detailled error message is no longer placed into the Exception.
There was indeed a bug in the SDK. I fixed it and released 2.0 beta 2. You can download it at http://code.google.com/p/trackmania-ws- ... loads/list
m4rcel wrote:I now tried myself to acces the private data of a user, and I only get an Error 400 Bad Request when calling Player->getPlayer()
Can you provide the error message now that the SDK is fixed?
m4rcel wrote:When trying to call Player->getBuddies(), Player->getEmail() or Player->isOnline(), I always get 401 Not Authorized, although I allowed access to these data.
That's normal. You got a 400 when retrieving the OAuth2 Access Token, so every protected request you make after that will fail because you don't have the access token (hence the 401, just like when you try to access a protected page without giving username/password).
m4rcel wrote:Another thing, not directly related with the SDK but maybe with the problem, is that the ManiaPlanet-forum is redirecting to the TMF Playerpage when clicking this "TrackMania Link Account" button in the profile settings, and not to this Allow-Access-page as before. (So you have no chance to change the displayed information atm.)
Yep it's been reported. It's not related, but I should probably fix that someday :roll:
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)

User avatar
m4rcel
Posts: 653
Joined: 15 Jun 2010, 11:12
Contact:

Re: [beta] SDK 2.0 with Namespaces and OAuth2 support!

Post by m4rcel » 25 Jul 2011, 17:01

I checked again the error, and now I get as message:
400 Bad Request wrote:Invalid object property "amp;client_secret"
So there seems to be an htmlspecialchars() too much somewhere ^^
ImageImage
Image

Post Reply

Return to “Trackmania Forever Web Services”

Who is online

Users browsing this forum: No registered users and 1 guest