Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- linked.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent evt) {
- Oauth2 auth2 = new Oauth2("https://www.linkedin.com/oauth/v2/authorization?response_type=code",
- "81lq3qpacjvkcu",
- "https://www.codenameone.com","r_fullprofile%20r_emailaddress","https://www.linkedin.com/uas/oauth2/accessToken","vzwWfamZ3IUQsJQL");
- Oauth2.setBackToParent(true);
- auth2.showAuthentication(new ActionListener() {
- public void actionPerformed(ActionEvent evt) {
- if (evt.getSource() instanceof String) {
- String token = (String) evt.getSource();
- String expires = Oauth2.getExpires();
- System.out.println("Token=" +token + "Expires in " +expires );
- } else {
- Exception err = (Exception) evt.getSource();
- err.printStackTrace();
- Dialog.show("Error", "An error occurred while logging in: " + err, "OK", null);
- }
- }
- });
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement