@Test public void testUser() { HybridProvider provider = new HybridProvider(); AccessToken accessToken = provider.getAccessToken("alice@example.com", SCOPES); assertEquals( "FakeAccessToken/GoogleIdentity=alice@example.com;Scopes=" + String.join(",", SCOPES), accessToken.getValue()); }
@Override public AccessToken getAccessToken(String googleIdentity, List<String> scopes) { if (googleIdentity.endsWith(".iam.gserviceaccount.com")) { return serviceAccountProvider.getAccessToken(googleIdentity, scopes); } else { return userProvider.getAccessToken(googleIdentity, scopes); } }
HybridProvider extends AbstractProvider { @Override public AccessToken getAccessToken(String googleIdentity, List<String> scopes) { if (googleIdentity.endsWith(".iam.gserviceaccount.com")) { return serviceAccountProvider.getAccessToken(googleIdentity, scopes); } else { return userProvider.getAccessToken(googleIdentity, scopes); } } }
HybridProvider extends AbstractProvider { @Override public AccessToken getAccessToken(String googleIdentity, List<String> scopes) { if (googleIdentity.endsWith(".iam.gserviceaccount.com")) { return serviceAccountProvider.getAccessToken(googleIdentity, scopes); } else { return userProvider.getAccessToken(googleIdentity, scopes); } } HybridProvider(); }
HybridProvider extends AbstractProvider { @Override public AccessToken getAccessToken(String googleIdentity, List<String> scopes) { if (googleIdentity.endsWith(".iam.gserviceaccount.com")) { return serviceAccountProvider.getAccessToken(googleIdentity, scopes); } else { return userProvider.getAccessToken(googleIdentity, scopes); } } HybridProvider(); @Override AccessToken getAccessToken(String googleIdentity, List<String> scopes); }
HybridProvider extends AbstractProvider { @Override public AccessToken getAccessToken(String googleIdentity, List<String> scopes) { if (googleIdentity.endsWith(".iam.gserviceaccount.com")) { return serviceAccountProvider.getAccessToken(googleIdentity, scopes); } else { return userProvider.getAccessToken(googleIdentity, scopes); } } HybridProvider(); @Override AccessToken getAccessToken(String googleIdentity, List<String> scopes);  }