Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$_POST with 301 Moved Permanently? #61

Closed
oozman opened this issue Jul 17, 2013 · 7 comments
Closed

$_POST with 301 Moved Permanently? #61

oozman opened this issue Jul 17, 2013 · 7 comments

Comments

@oozman
Copy link

oozman commented Jul 17, 2013

Hello,
I'm trying to setup the library on Laravel4.

Why is it that it POST to the right callback url with 301 on it,
and then redirects back to the callback url using this time a GET request.

I feel everything are setup just fine.

Let me know if you have some insights to where should I look next.

Thanks much.

@oozman
Copy link
Author

oozman commented Jul 17, 2013

Additional Info:
I'm using "post" as my callback_transport.
But when I use "get" as my callback_transport, it authenticates me just fine.

@uzyn
Copy link
Member

uzyn commented Jul 17, 2013

The final callback depends on the transport that is configured at Opauth configuration.

See callback_transport at https://github.com/opauth/opauth/wiki/Opauth-configuration

@uzyn
Copy link
Member

uzyn commented Jul 17, 2013

Are you using any plugin or wrapper of Opauth (eg. Opauth plugin for Laravel) that overrides your configuration?

@oozman
Copy link
Author

oozman commented Jul 17, 2013

No, I'm not using any wrapper or any plugin that will override the configuration.
I got the library using composer (packagist) and I'm using the format shown in the wiki configuration.

  • session for sure will not work for me at this time since I'm using a database as my session storage.
  • get works fine with me.
  • post I believe works fine also since I got the supposed $_POST['opauth'] data (console) except that it redirects back to my callback url using $_GET.

@uzyn
Copy link
Member

uzyn commented Jul 17, 2013

If you can see $_POST['opauth'] then Opauth is behaving correctly and ends right there. The final GET is probably after Opauth.

Do you have some URLs to share? The URL that accepted the POST and the final one that accepted the GET?

@oozman
Copy link
Author

oozman commented Jul 17, 2013

I think it's resolved now on my end.
It's a callback_url issue, I guess.

I just want to share it, for Laravel4 guys.

The callback_url is set to like this:

'callback_url' =>  '/auth/done/';

I'm not sure but it's POSTing just fine on this URL with 301 http status.

But when it was changed to a full path:

'callback_url' =>  URL::to('auth/done'),

post callback_transport works fine now.

@uzyn
Copy link
Member

uzyn commented Jul 17, 2013

Thanks for sharing your finding, @OmarUsman

@uzyn uzyn closed this as completed Jul 17, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants