Index: /trunk/src/org/openstreetmap/josm/gui/JosmUserIdentityManager.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/JosmUserIdentityManager.java	(revision 5433)
+++ /trunk/src/org/openstreetmap/josm/gui/JosmUserIdentityManager.java	(revision 5434)
@@ -4,4 +4,5 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
+import java.awt.Component;
 import java.text.MessageFormat;
 
@@ -11,4 +12,7 @@
 import org.openstreetmap.josm.data.Preferences.StringSetting;
 import org.openstreetmap.josm.data.osm.UserInfo;
+import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
+import org.openstreetmap.josm.io.OsmServerUserInfoReader;
+import org.openstreetmap.josm.io.OsmTransferException;
 import org.openstreetmap.josm.io.auth.CredentialsManager;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
@@ -34,10 +38,10 @@
  * of what the current JOSM instance knows about the current user. Other subsystems can
  * let the global JosmUserStateManager know in case they fully identify the current user, see
- * {@link #setFullyIdentified(String, long)}.
+ * {@link #setFullyIdentified}.
  *
  * The information kept by the JosmUserStateManager can be used to
  * <ul>
  *   <li>safely query changesets owned by the current user based on its user id, not on its user name</li>
- *   <li>safely search for objects last touched by the current user  based on its user id, not on its user name</li>
+ *   <li>safely search for objects last touched by the current user based on its user id, not on its user name</li>
  * </ul>
  *
@@ -166,6 +170,9 @@
         return userInfo;
     }
-    /**
-     * Initializes the user identity manager from values in the {@link org.openstreetmap.josm.data.Preferences}
+    
+    /**
+     * Initializes the user identity manager from Basic Authentication values in the {@link org.openstreetmap.josm.data.Preferences}
+     * This method should be called if {@code osm-server.auth-method} is set to {@code basic}.
+     * @see #initFromOAuth
      */
     public void initFromPreferences() {
@@ -182,4 +189,22 @@
                 // keep the state, be it partially or fully identified
             }
+        }
+    }
+
+    /**
+     * Initializes the user identity manager from OAuth request of user details.
+     * This method should be called if {@code osm-server.auth-method} is set to {@code oauth}.
+     * @param parent component relative to which the {@link PleaseWaitDialog} is displayed.
+     * @see #initFromPreferences
+     * @since 5434
+     */
+    public void initFromOAuth(Component parent) {
+        try {
+            UserInfo info = new OsmServerUserInfoReader().fetchUserInfo(NullProgressMonitor.INSTANCE);
+            setFullyIdentified(info.getDisplayName(), info);
+        } catch (IllegalArgumentException e) {
+            e.printStackTrace();
+        } catch (OsmTransferException e) {
+            e.printStackTrace();
         }
     }
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManager.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManager.java	(revision 5433)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManager.java	(revision 5434)
@@ -532,8 +532,12 @@
         public void actionPerformed(ActionEvent arg0) {
             JosmUserIdentityManager im = JosmUserIdentityManager.getInstance();
-            im.initFromPreferences();
-            if (im.isAnonymous()) {
-                alertAnonymousUser();
-                return;
+            if (Main.pref.get("osm-server.auth-method").equals("oauth")) {
+                im.initFromOAuth(ChangesetCacheManager.this);
+            } else {
+                im.initFromPreferences();
+                if (im.isAnonymous()) {
+                    alertAnonymousUser();
+                    return;
+                }
             }
             ChangesetQuery query = new ChangesetQuery();
Index: /trunk/src/org/openstreetmap/josm/io/OsmServerUserInfoReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmServerUserInfoReader.java	(revision 5433)
+++ /trunk/src/org/openstreetmap/josm/io/OsmServerUserInfoReader.java	(revision 5434)
@@ -97,5 +97,5 @@
 
             // -- language list
-            NodeList xmlNodeList = (NodeList)xpath.compile("/osm/user[1]/languages[1]/lang").evaluate(document, XPathConstants.NODESET);
+            NodeList xmlNodeList = (NodeList)xpath.compile("/osm/user[1]/languages[1]/lang/text()").evaluate(document, XPathConstants.NODESET);
             if (xmlNodeList != null) {
                 List<String> languages = new LinkedList<String>();
