[Potlatch-dev] Oauth Struggles

Eric Wolf ebwolf at gmail.com
Mon Dec 13 22:20:39 GMT 2010


I'm trying to get Potlatch2 setup as the default editor on our OSMCP server
(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). 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.

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.

When I try to open the editor, I get the following error:

NameError in Site#edit

Showing *app/views/site/edit.html.erb* where line *#83* raised:

undefined local variable or method `token' for
#<ActionView::Base:0x7fcbb1a1b358>

Extracted source (around line *#83*):

80:     fo.addVariable("api","<%= request.protocol +
request.host_with_port %>/api/<%= API_VERSION %>/");
81:     fo.addVariable("policy","<%= request.protocol +
request.host_with_port %>/api/crossdomain.xml");
82:     fo.addVariable("connection","XML");
83:     fo.addVariable("oauth_token","<%= token.token %>");
84:     fo.addVariable("oauth_token_secret","<%= token.secret %>");
85:     fo.addVariable("oauth_consumer_key","<%=
token.client_application.key %>");
86:     fo.addVariable("oauth_consumer_secret","<%=
token.client_application.secret %>");

RAILS_ROOT: /osmcp/rails
Application Trace <http://navigator.er.usgs.gov/edit#> | Framework
Trace<http://navigator.er.usgs.gov/edit#>
 | Full Trace <http://navigator.er.usgs.gov/edit#>

/osmcp/rails/app/views/site/edit.html.erb:83:in
`_run_erb_app47views47site47edit46html46erb'

Request

*Parameters*:

None

Show session dump <http://navigator.er.usgs.gov/edit#>
Response

*Headers*:

{"Vary"=>"*",
 "Content-Language"=>"en",
 "Content-Type"=>"text/html",
 "Cache-Control"=>"no-cache"}


Thoughts? I've been spinning my wheels on this for a couple hours.

-Eric

-=--=---=----=----=---=--=-=--=---=----=---=--=-=-
Eric B. Wolf                           720-334-7734
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/potlatch-dev/attachments/20101213/448ba94b/attachment.html>


More information about the Potlatch-dev mailing list