Skip to content

JOAuth 2.0 Client #1423

Closed
wants to merge 23 commits into from

6 participants

@aaronschmitz

This is an OAuth 2.0 client for requesting access tokens and sending signed requests. I created it as a part of my JGoogle GSoC project (http://goo.gl/5dj50).

@aaronschmitz

See also Diana's 1.0a client: #1422

@realityking realityking commented on an outdated diff Aug 2, 2012
libraries/joomla/oauth/oauth2client.php
@@ -0,0 +1,344 @@
+<?php
+/**
+ * @package Joomla.Platform
+ * @subpackage Oauth
+ *
+ * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
+ * @license GNU General Public License version 2 or later; see LICENSE
+ */
+
+defined('JPATH_PLATFORM') or die;
+jimport('joomla.environment.response');
+jimport('joomla.environment.uri');
@realityking
Joomla! member
realityking added a note Aug 2, 2012

The jimport for JUri isn't necessary anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@stefanneculai stefanneculai commented on an outdated diff Aug 2, 2012
libraries/joomla/oauth/oauth2client.php
+ *
+ * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
+ * @license GNU General Public License version 2 or later; see LICENSE
+ */
+
+defined('JPATH_PLATFORM') or die;
+jimport('joomla.environment.response');
+
+/**
+ * Joomla Platform class for interacting with an OAuth 2.0 server.
+ *
+ * @package Joomla.Platform
+ * @subpackage Oauth
+ * @since 12.2
+ */
+class JOauthOauth2client
@stefanneculai
stefanneculai added a note Aug 2, 2012

I find it strange to name the class JOauthOauth2client. Wouldn't it be better to change the name to JOauth2client (it sounds more natural)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@elinw
elinw commented Aug 2, 2012

Then wouldn't the autoloader be looking for a file named 2client?

@stefanneculai

Would be a problem to name it 2client.php?
Maybe make a folder called v2 and put the client.php in it. This way it would be JOAuthV2client.

@aaronschmitz

I suppose it wouldn't be a problem.

@elinw
elinw commented Aug 4, 2012

I think I'd like to hear from the maintainers on this one.

Just FYI Aaron needs to know about the patch() issue in order to know how to fix the unit test that has an error.

@aaronschmitz

Ok. I switch to extending JHttp like JGithub does. If the maintainers accept @dianaprajescu's pull for the patch method I'm 95% of the way there, and if they don't this is a superior alternative to using JHttpTransport.

For now, I renamed the class to JOauth2client and the file to 2client, but I'm flexible on what others prefer.

@aaronschmitz

@louislandry, is this what you were thinking?

That's fine, but you'd also have to call $application->sendHeaders(); I believe. Is there some reason that you couldn't just use $application->redirect() and needed to do it this way?

@pasamio
pasamio commented Sep 24, 2012

@aaronschmitz do you mind renaming it from oauth/v2client.php to oauth2/client.php? Given it seems to be an independent implementation with no sharing of code between the two implementations.

@elinw
elinw commented Sep 28, 2012

@pasamio can you comment on whether the class name should be JOAuth or JOauth (my understanding is that the loader looks for non consecutive upper case letters which would make JOAuth okay. Codestyle originally called for uppercase where appropriate (HTML ZXML) but we veered away from that with implementation of the autoloader. We probably should aim for some consistency.

@aaronschmitz

Closing in favor of #1480.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.