Ignore:
Timestamp:
2015-07-06T15:57:42+02:00 (10 years ago)
Author:
nokutu
Message:

Added externals again, JOSM doesn't support oauth 2.0

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 
         1https://github.com/fernandezpablo85/scribe-java/trunk/src/main/java/org/scribe scribe
         2http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/ apache
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryOAuthUI.java

    r31340 r31342  
    11package org.openstreetmap.josm.plugins.mapillary.gui;
     2
     3import java.util.Scanner;
    24
    35import javax.swing.JLabel;
    46import javax.swing.JPanel;
    57
     8import org.openstreetmap.josm.plugins.mapillary.oauth.MapillaryOAuthApi;
     9import org.scribe.builder.ServiceBuilder;
     10import org.scribe.model.Token;
     11import org.scribe.model.Verifier;
     12import org.scribe.oauth.OAuthService;
     13
     14/**
     15 * JPanel used to get the OAuth tokens from Mapillary.
     16 *
     17 * @author nokutu
     18 *
     19 */
    620public class MapillaryOAuthUI extends JPanel {
    721
     22    private static final Token EMPTY_TOKEN = null;
     23
    824    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();
    1040    }
    1141
Note: See TracChangeset for help on using the changeset viewer.