[beta] SDK 2.0 with Namespaces and OAuth2 support!

Trackmania Forever public API and its open source PHP SDK.

Moderator: NADEO

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

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

Post by m4rcel »

gouxim said somewhere (don't know exactly where), that the MPWS will be pretty much the same as TMWS ;)
ImageImage
Image
User avatar
w1lla
Posts: 2287
Joined: 15 Jun 2010, 11:09
Location: Netherlands
Contact:

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

Post by w1lla »

TM² Info
SM Info
QM Info

OS: Windows 10 x64 Professional
MB: MSI 970A-G46
Processor: AMD FX-6300 3500 mHz
RAM Memory: 16 GB DDR3
Video: SAPPHIRE DUAL-X R9 280X 3GB GDDR5
KB: Logitech G510s
Mouse: Logitech G300s
Mode Creation
ManiaScript Docs
User avatar
bas_3008
Posts: 52
Joined: 06 Apr 2011, 21:43

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

Post by bas_3008 »

Hello,
I am currently messing arround with your Trackmania WS SDK 2.0! :thumbsup:
It's great, but I have got 2 problems:

1. When I open /oauth2/guestbook/index.php from the examples, there's a

Code: Select all

Fatal error: Class 'TrackMania\WebServices\OAuth2\Base' not found in ~~~
In the OAuth2 directory, theres no Base.php, just Client.php and Players.php! Is that the mistake? Or do I make something wrong?

2. When I open /oauth2/basic/index.php , I click on "Login with your TrackMania Forever account", I login there, but then "Something went wrong, please try again later"! :(

Btw: I'm using xampp on my localhost to test this.
My TM-login is bas_3008, API-username is epic-lol.
I registered an OAuth2 application, named epic-clan.de, redirection URL is http://www.epic-clan.de.

It's the first time I'm working with a SDK, it would be great if you could help me with this.

Thanks in advance!
ImageImage
User avatar
gouxim
Nadeo
Nadeo
Posts: 1186
Joined: 14 Jun 2010, 17:20

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

Post by gouxim »

bas_3008 wrote:1. When I open /oauth2/guestbook/index.php from the examples, there's a

Code: Select all

Fatal error: Class 'TrackMania\WebServices\OAuth2\Base' not found in ~~~
In the OAuth2 directory, theres no Base.php, just Client.php and Players.php! Is that the mistake? Or do I make something wrong?
There's a bug in the example.
http://code.google.com/p/trackmania-ws- ... dex.php#86
Line 91 it shouldn't be new \TrackMania\WebServices\OAuth2\Base but new \TrackMania\WebServices\OAuth2\Player
bas_3008 wrote:2. When I open /oauth2/basic/index.php , I click on "Login with your TrackMania Forever account", I login there, but then "Something went wrong, please try again later"! :(

Btw: I'm using xampp on my localhost to test this.
My TM-login is bas_3008, API-username is epic-lol.
I registered an OAuth2 application, named epic-clan.de, redirection URL is http://www.epic-clan.de.
I checked in the DB, redirection URL is not "http://www.epic-clan.de" but "www.epic-clan.de".
Try to put with http:// in your OAuth2 application settings.
Also not that it can only work on that domain name. If you want to test it locally (on http://127.0.0.1) you have to create a username and an oauth2 app for that.
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
User avatar
bas_3008
Posts: 52
Joined: 06 Apr 2011, 21:43

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

Post by bas_3008 »

Okay thanks!
I tried it - /guestbook/index.php now says:

Code: Select all

Fatal error: Call to undefined method TrackMania\WebServices\OAuth2\Player::getLogin() in D:\xampp\htdocs\trackmania-ws-sdk\examples\oauth2\guestbook\index.php on line 92
--

I changed the URL direction to http://127.0.0.1, opened /basic/index.php, I allowed access to my App and I got redirected to http://127.0.0.1/trackmania-ws-sdk/exam ... guestbook/ and ... okay, now it works. First time, I did that, there was a warning like "int(0) string" or something and I had to log in again. Now I'm authentified and I get my TrackMania data :thumbsup:
(but guestbook still doesn't work :| )
ImageImage
User avatar
bas_3008
Posts: 52
Joined: 06 Apr 2011, 21:43

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

Post by bas_3008 »

When I'm logged in (/basic/index.php) and I refresh the page, it get

Code: Select all

int(401) string(12) "Unauthorized" string(0) "" 
Is this normal? :?

btw: it's on my webspace now, http://epic-clan.de/trackmania-ws-sdk/e ... /index.php
ImageImage
User avatar
gouxim
Nadeo
Nadeo
Posts: 1186
Joined: 14 Jun 2010, 17:20

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

Post by gouxim »

There was a bug in the SDK. I commited the fix, you can see the difference here:

http://code.google.com/p/trackmania-ws- ... Player.php
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
User avatar
bas_3008
Posts: 52
Joined: 06 Apr 2011, 21:43

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

Post by bas_3008 »

Yeah! Works great now! Thanks! :thumbsup:
ImageImage
User avatar
Jojo_44
Posts: 485
Joined: 12 Jul 2010, 15:58
Location: Germany->Bavaria
Contact:

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

Post by Jojo_44 »

Hi,

the redirection for the logout doesn´t work anymore. At least for me ;)

regards, Jojo
Image
my english sounds very unfriendly but it isn´t ;)
User avatar
gouxim
Nadeo
Nadeo
Posts: 1186
Joined: 14 Jun 2010, 17:20

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

Post by gouxim »

I think it never have.
:lol:
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
Post Reply

Return to “Trackmania Forever Web Services”

Who is online

Users browsing this forum: No registered users and 0 guests