Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
problem with tokens in my Google Summer of Code
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Javier Gómez  
View profile  
 More options Aug 15 2012, 8:07 pm
From: Javier Gómez <javier.gomez.co...@gmail.com>
Date: Wed, 15 Aug 2012 17:07:50 -0700 (PDT)
Local: Wed, Aug 15 2012 8:07 pm
Subject: [GSoC] problem with tokens in my Google Summer of Code

Hi,

In the part two of my Google Summer of Code project you are available to
install languages in Joomla! CMS during the installation process.
You will have a better understanding if you watch this 4 minutes video that
explains what the project does: http://www.youtube.com/watch?v=jufj5kCT6Uw

This is my Alpha2 release that "almost" works. But I need your help with an
issue that I don't know how to solve.

The problem is in file /installation/controllers/setup.json.php, in lines:

509 JSession::checkToken('request') or $this->sendResponse(new
Exception(JText::_('JINVALID_TOKEN'), 403));

574 JSession::checkToken('request') or $this->sendResponse(new
Exception(JText::_('JINVALID_TOKEN'), 403));

If you comment this lines It works. But the right solution should check the
tokens to prevent atacks (see:
http://docs.joomla.org/How_to_add_CSRF_anti-spoofing_to_forms). The
checktoken() doesn't work because the two tokens are different. Why? I
don't know, and that is the problem ^_^

Please feel free to test it:

Files:

   - *install the ready to test* "joomla distro" (a complete Joomla! distro
   that includes the feature):
   https://dl.dropbox.com/u/1648056/GSOC2012/part2/tokenbug/joomla-distr...
   - *Or use* the "Git Patch" (test it against 2.5.x joomla-cms branch in
   Github):
   https://dl.dropbox.com/u/1648056/GSOC2012/part2/tokenbug/joomla-distr...
   - *Or* get the code directly from my Github
   branch: https://github.com/javigomez/GSOC-Installation/tree/languageinstaller...

Thanks so much for your help.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "[GSoC] problem with tokens in my Google Summer of Code" by Ole Ottosen (ot2sen)
Ole Ottosen (ot2sen)  
View profile  
 More options Aug 16 2012, 2:53 am
From: "Ole Ottosen (ot2sen)" <ot2...@gmail.com>
Date: Thu, 16 Aug 2012 08:53:40 +0200
Local: Thurs, Aug 16 2012 2:53 am
Subject: Re: [jcms] [GSoC] problem with tokens in my Google Summer of Code

Hi Javier,

Exciting stuff! Did a quick test to just see how one of the most important
features in years were progressing.
Was so great to see the list of languages to choose from. Did I say it was
exciting :D

I did meet the roadblock you mention of a token, and cant give much valid
feedback with my "color blind" understanding of code...
But maybe, just maybe it could be that this new action need to be in
installation.js too?

Note: I didnt have sound when watching the video, so it could be you
mentioned it. They langauges steps will be adde before the current 'Finish'
step, right? Right now having the button below the 'Remove folder' button'
is sort of riski, as it is tempting to click remove first.

Keep up the good work Javier!

Cheers,

Ole

On Thu, Aug 16, 2012 at 2:07 AM, Javier Gómez
<javier.gomez.co...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Javier Gómez  
View profile  
 More options Aug 16 2012, 10:56 am
From: Javier Gómez <javier.gomez.co...@gmail.com>
Date: Thu, 16 Aug 2012 07:56:50 -0700 (PDT)
Local: Thurs, Aug 16 2012 10:56 am
Subject: Re: [jcms] [GSoC] problem with tokens in my Google Summer of Code

Hi Ole,

Thanks very much for your nice words. I'm really excited also, I think that
this feature could help a lot of non-native english speakers.

You said:

> Right now having the button below the 'Remove folder' button' is sort of
> riski, as it is tempting to click remove first.

That is a very good point. I have already take care of it, If the user
clicks in "remove folder" the installation.js has a new line that will make
the "install languages" button inactive.

You said:

> But maybe, just maybe it could be that this new action need to be in
> installation.js too?

Mmm that has sense, I will investigate there. Thanks

Thanks again.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Javier Gómez  
View profile  
 More options Aug 17 2012, 4:30 pm
From: Javier Gómez <javier.gomez.co...@gmail.com>
Date: Fri, 17 Aug 2012 13:30:26 -0700 (PDT)
Local: Fri, Aug 17 2012 4:30 pm
Subject: Re: [jcms] [GSoC] problem with tokens in my Google Summer of Code

I found the solution.

The problem was that the tokes where
different: https://dl.dropbox.com/u/1648056/GSOC2012/part2/tokenbug/problem1.png

And they where different because Joomla! uses the configuration.php "secret
word" to build the hash of the token (this make your tokens different from
other installations even if you session id):  
https://dl.dropbox.com/u/1648056/GSOC2012/part2/tokenbug/problem2.png

The configuration depends on the application. During installation in
Joomla! there is no configuration.php, so there is not "secret word". And
in my language installation I'm using the just created "configuration.php"
to be able to use the JUpdater and other classes that needs the main
configuration file.

So I just did that:

public function installLanguages()
{
+ JFactory::$config = null;
+ JFactory::getConfig(JPATH_SITE . '/configuration.php');
+ JFactory::$session = null;

// Check for a valid token. If invalid, send a 403 with the error message.
JSession::checkToken() or $this->sendResponse(new
Exception(JText::_('JINVALID_TOKEN'), 403));

That makes Joomla! to reload the config including the configuration.php
information.

By now it looks like a hack, maybe doesn't look bad for you. I was
wondering if any of you have any idea of how to make it look better?

Thanks everyone


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt Thomas  
View profile   Translate to Translated (View Original)
 More options Aug 17 2012, 4:46 pm
From: Matt Thomas <m...@betweenbrain.com>
Date: Fri, 17 Aug 2012 16:46:57 -0400
Local: Fri, Aug 17 2012 4:46 pm
Subject: Re: [jcms] [GSoC] problem with tokens in my Google Summer of Code

That's awesome that you found a solution. I suspect sharing that might help
others too.

Wish I could lend more than that as this is far beyond me :-)

Happy to see this progressing further!

Best,

Matt Thomas
Founder betweenbrain <http://betweenbrain.com/>™
Lead Developer Construct Template Development
Framework<http://construct-framework.com/>
Phone: 203.632.9322
Twitter: @betweenbrain
Github: https://github.com/betweenbrain

On Fri, Aug 17, 2012 at 4:30 PM, Javier Gómez
<javier.gomez.co...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »