Changeset 31342 in osm for applications/editors/josm/plugins/mapillary/src
- Timestamp:
- 2015-07-06T15:57:42+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/mapillary/src/org
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org
- Property svn:externals
-
old new 1 1 https://github.com/fernandezpablo85/scribe-java/trunk/src/main/java/org/scribe scribe 2 http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/ apache
-
- Property svn:externals
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryOAuthUI.java
r31340 r31342 1 1 package org.openstreetmap.josm.plugins.mapillary.gui; 2 3 import java.util.Scanner; 2 4 3 5 import javax.swing.JLabel; 4 6 import javax.swing.JPanel; 5 7 8 import org.openstreetmap.josm.plugins.mapillary.oauth.MapillaryOAuthApi; 9 import org.scribe.builder.ServiceBuilder; 10 import org.scribe.model.Token; 11 import org.scribe.model.Verifier; 12 import org.scribe.oauth.OAuthService; 13 14 /** 15 * JPanel used to get the OAuth tokens from Mapillary. 16 * 17 * @author nokutu 18 * 19 */ 6 20 public class MapillaryOAuthUI extends JPanel { 7 21 22 private static final Token EMPTY_TOKEN = null; 23 8 24 public MapillaryOAuthUI() { 9 this.add(new JLabel("Aquí esta el login")); 25 Scanner in = new Scanner(System.in); 26 OAuthService service = new ServiceBuilder() 27 .provider(MapillaryOAuthApi.class) 28 .apiKey("NzNRM2otQkR2SHJzaXJmNmdQWVQ0dzo1YTA2NmNlODhlNWMwOTBm") 29 .apiSecret("Secret").build(); 30 String authorizationUrl = service.getAuthorizationUrl(EMPTY_TOKEN); 31 this.add(new JLabel("Login")); 32 System.out.println("Fetching the Authorization URL..."); 33 System.out.println("Got the Authorization URL!"); 34 System.out.println("Now go and authorize Scribe here:"); 35 System.out.println(authorizationUrl); 36 System.out.println("And paste the authorization code here"); 37 System.out.print(">>"); 38 Verifier verifier = new Verifier(in.nextLine()); 39 System.out.println(); 10 40 } 11 41
Note:
See TracChangeset
for help on using the changeset viewer.