[Potlatch-dev] Oauth Struggles
Tom Hughes
tom at compton.nu
Mon Dec 13 22:56:26 GMT 2010
On 13/12/10 22:20, Eric Wolf wrote:
> I'm trying to get Potlatch2 setup as the default editor on our OSMCP
> server (navigator.er.usgs.gov <http://navigator.er.usgs.gov>). We built
> the site using a snapshot of the OSM code from May 14, 2010. I've setup
> Potlatch2 in the rails/public/p2 directory (you can hit it via
> navigator.er.usgs.gov/p2/potlatch2.html
> <http://navigator.er.usgs.gov/p2/potlatch2.html>). I've been able to
> configure Oauth to work with that URL. To get it to work on the Edit
> tab, I cut the code out of /app/views/site/_potlatch2.html.erb and
> pasted it over the old code in /app/views/site/index.html.erb. I don't
> want to let the user select between Potlatch 1 & 2 - just take them
> straight to 2.
If you want it to default to Potlatch 2 then just change the default
editor in config/application.yml and if you want to hide Potlatch 1
then remove it from the list of available editors in lib/editors.rb.
That will be far more robust than fiddling with the code.
I have no idea why you are pasting _potlatch2.html.erb into the index
page anyway - that drives the view tab not the edit tab. I suggest you
undo that as it sounds like you have broken things.
> I've gone through as much of the Rails app as I can seem to track down
> (I'm a Rails n00b) and updated everything related to oauth. I noticed in
> OSM, on my "oauth settings" I've got "Potlatch2" list as a "token issued
> in my name". On my site, I can't figure out how to issue Oauth tokens.
Once again I suggest you undo whatever you have "updated" as there
should be no need to change any of the code.
Tokens will be issued automatically. All you need to do is register an
OAuth application for PL2 and then put the key value into the config
file and everything else will happen automatically.
Go to your user page, then "oauth settings" and "Register your
application" and fill in the details (the callback and support urls can
be left blank) and you will get given the key value.
Tom
--
Tom Hughes (tom at compton.nu)
http://compton.nu/
More information about the Potlatch-dev
mailing list