Modify

Opened 10 months ago

Last modified 9 months ago

#7943 new defect

Default OAuth settings not in line with used API server

Reported by: Don-vip Owned by: team
Priority: normal Component: Core
Version: Keywords: OAuth
Cc:

Description

I switched to master dev OSM API server (http://api06.dev.openstreetmap.org) to fix #7938 and it took me a moment to understand why I wasn't able to create a changeset.
After setting up the API server, I created a new OAuth token with the wizard, but did not see that the default advanced params are always set to:

Request Token URL: http://www.openstreetmap.org/oauth/request_token
Access Token URL: http://www.openstreetmap.org/oauth/access_token
Authorize URL: http://www.openstreetmap.org/oauth/authorize 

Two things to fix:

  • When a complete custom API server is set, the defaults settings should not be used and the user forced to enter the OAuth URLs
  • When a known dev OSM API is used (i.e. ending by dev.openstreetmap.org), the default settings should be set to
    Request Token URL: http://<name>.dev.openstreetmap.org/oauth/request_token
    Access Token URL: http://<name>.dev.openstreetmap.org/oauth/access_token
    Authorize URL: http://<name>.dev.openstreetmap.org/oauth/authorize 
    

Attachments (0)

Change History (5)

comment:1 Changed 10 months ago by Don-vip

In 5411/josm:

see #7943 - Fix OAuth rejection error message

comment:2 follow-up: Changed 10 months ago by Don-vip

I am still unable to access dev API server with JOSM and OAuth but I don't understand if I'm doing something wrong or what. Has someone else ever tried ?

The only thing I am able to do is getting a weird NPE when switching back to standard API server and validating the preferences dialog:

Build-Date: 2012-08-09 21:45:10
Revision: 5411
Is-Local-Build: true

Identification: JOSM/1.5 (5411 SVN en)
Memory Usage: 156 MB / 1816 MB (55 MB allocated, but free)
Java version: 1.7.0_05, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Operating system: Windows 7

java.lang.NullPointerException
	at org.openstreetmap.josm.data.Preferences$AbstractSetting.toString(Preferences.java:125)
	at java.text.MessageFormat.subformat(Unknown Source)
	at java.text.MessageFormat.format(Unknown Source)
	at java.text.Format.format(Unknown Source)
	at java.text.MessageFormat.format(Unknown Source)
	at org.openstreetmap.josm.tools.I18n.tr(I18n.java:151)
	at org.openstreetmap.josm.gui.io.UploadDialog.preferenceChanged(UploadDialog.java:505)
	at org.openstreetmap.josm.data.Preferences.firePreferenceChanged(Preferences.java:237)
	at org.openstreetmap.josm.data.Preferences.put(Preferences.java:488)
	at org.openstreetmap.josm.gui.preferences.server.OsmApiUrlInputPanel.saveToPreferences(OsmApiUrlInputPanel.java:141)
	at org.openstreetmap.josm.gui.preferences.ServerAccessPreference.ok(ServerAccessPreference.java:133)
	at org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane$3.run(PreferenceTabbedPane.java:254)
	at org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane.savePreferences(PreferenceTabbedPane.java:303)
	at org.openstreetmap.josm.gui.preferences.PreferenceDialog$OKAction.actionPerformed(PreferenceDialog.java:159)
Last edited 10 months ago by Don-vip (previous) (diff)

comment:3 Changed 10 months ago by Don-vip

In 5412/josm:

see #7943 - fix NPE when switching back to default OSM API server after having tried to upload data to another server instance

comment:4 Changed 9 months ago by Don-vip

In 5422/josm:

see #7943 - Introduce OsmApi.DEFAULT_API_URL, better handling of change of API URL in OAuth management, javadoc improvements

comment:5 in reply to: ↑ 2 Changed 9 months ago by Don-vip

Replying to Don-vip:

I am still unable to access dev API server with JOSM and OAuth but I don't understand if I'm doing something wrong or what. Has someone else ever tried ?

No progress on this, even after the update. Could it be a problem on OSM side ?

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as new .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team. Next status will be 'new'.
Next status will be 'needinfo'.The owner will change to Don-vip
as duplicate The resolution will be set to duplicate. Next status will be 'closed'.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous. Next status will be 'assigned'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.