(String code, String userId)
| 75 | } |
| 76 | |
| 77 | public String fetchToken(String code, String userId) throws IOException { |
| 78 | TokenResponse tokenResponse = this.flow.newTokenRequest(code) |
| 79 | .setRedirectUri(this.redirectUri) |
| 80 | .execute(); |
| 81 | credential = this.flow.createAndStoreCredential(tokenResponse, userId); |
| 82 | return credential.getAccessToken(); |
| 83 | } |
| 84 | |
| 85 | public String fetchToken(String code) throws IOException { |
| 86 | return fetchToken(code, null); |