/** * Create proxy credentials. * * @param cloudCredentials credentials to use * @param proxyForUser user to be proxied */ public CloudCredentials(CloudCredentials cloudCredentials, String proxyForUser) { this.email = cloudCredentials.getEmail(); this.password = cloudCredentials.getPassword(); this.clientId = cloudCredentials.getClientId(); this.token = cloudCredentials.getToken(); this.proxyUser = proxyForUser; }
/** * Create proxy credentials. * * @param cloudCredentials credentials to use * @param proxyForUser user to be proxied */ public CloudCredentials(CloudCredentials cloudCredentials, String proxyForUser) { this.email = cloudCredentials.getEmail(); this.password = cloudCredentials.getPassword(); this.clientId = cloudCredentials.getClientId(); this.token = cloudCredentials.getToken(); this.proxyUser = proxyForUser; }
credentials.getEmail(), credentials.getPassword(), selfSigned, monitor);
public OAuth2AccessToken getToken() { if (token == null) { return null; } if(this.credentials.isRefreshable()) { if (token.getExpiresIn() < 50) { // 50 seconds before expiration? Then refresh it. token = refreshToken(token, credentials.getEmail(), credentials.getPassword(), credentials.getClientId(), credentials.getClientSecret()); } } return token; }
public OAuth2AccessToken getToken() { if (token == null) { return null; } if (this.credentials.isRefreshable()) { if (token.getExpiresIn() < 50) { // 50 seconds before expiration? Then refresh it. token = refreshToken(token, credentials.getEmail(), credentials.getPassword(), credentials.getClientId(), credentials.getClientSecret()); } } return token; }
@Override public void updatePassword(CloudCredentials credentials, String newPassword) { oauthClient.changePassword(credentials.getPassword(), newPassword); CloudCredentials newCloudCredentials = new CloudCredentials(credentials.getEmail(), newPassword); if (cloudCredentials.getProxyUser() != null) { cloudCredentials = newCloudCredentials.proxyForUser(cloudCredentials.getProxyUser()); } else { cloudCredentials = newCloudCredentials; } }
@Override public void updatePassword(CloudCredentials credentials, String newPassword) { oauthClient.changePassword(credentials.getPassword(), newPassword); CloudCredentials newCloudCredentials = new CloudCredentials(credentials.getEmail(), newPassword); if (cloudCredentials.getProxyUser() != null) { cloudCredentials = newCloudCredentials.proxyForUser(cloudCredentials.getProxyUser()); } else { cloudCredentials = newCloudCredentials; } }
public void init(CloudCredentials credentials) { if (credentials != null) { this.credentials = credentials; if (credentials.getToken() != null) { this.token = credentials.getToken(); } else { this.token = createToken(credentials.getEmail(), credentials.getPassword(), credentials.getClientId(), credentials.getClientSecret()); } } }
public void init(CloudCredentials credentials) { if (credentials != null) { this.credentials = credentials; if (credentials.getToken() != null) { this.token = credentials.getToken(); } else { this.token = createToken(credentials.getEmail(), credentials.getPassword(), credentials.getClientId(), credentials.getClientSecret()); } } }