congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ServiceAccountJwtAccessCredentials.getClientId
Code IndexAdd Tabnine to your IDE (free)

How to use
getClientId
method
in
com.google.auth.oauth2.ServiceAccountJwtAccessCredentials

Best Java code snippets using com.google.auth.oauth2.ServiceAccountJwtAccessCredentials.getClientId (Showing top 2 results out of 315)

origin: googleapis/gax-java

@Test
public void serviceAccountReplacedWithJwtTokens() throws Exception {
 ServiceAccountCredentials serviceAccountCredentials =
   ServiceAccountCredentials.newBuilder()
     .setClientId("fake-client-id")
     .setClientEmail("fake@example.com")
     .setPrivateKeyId("fake-private-key")
     .setPrivateKey(Mockito.mock(PrivateKey.class))
     .build();
 PowerMockito.mockStatic(GoogleCredentials.class);
 Mockito.when(GoogleCredentials.getApplicationDefault()).thenReturn(serviceAccountCredentials);
 GoogleCredentialsProvider provider =
   GoogleCredentialsProvider.newBuilder()
     .setScopesToApply(ImmutableList.of("scope1", "scope2"))
     .setJwtEnabledScopes(ImmutableList.of("scope1"))
     .build();
 Credentials credentials = provider.getCredentials();
 assertThat(credentials).isInstanceOf(ServiceAccountJwtAccessCredentials.class);
 ServiceAccountJwtAccessCredentials jwtCreds = (ServiceAccountJwtAccessCredentials) credentials;
 assertThat(jwtCreds.getClientId()).isEqualTo(serviceAccountCredentials.getClientId());
 assertThat(jwtCreds.getClientEmail()).isEqualTo(serviceAccountCredentials.getClientEmail());
 assertThat(jwtCreds.getPrivateKeyId()).isEqualTo(serviceAccountCredentials.getPrivateKeyId());
 assertThat(jwtCreds.getPrivateKey()).isEqualTo(serviceAccountCredentials.getPrivateKey());
}
origin: googleapis/google-auth-library-java

@Test 
public void constructor_allParameters_constructs() throws IOException {
 PrivateKey privateKey = ServiceAccountCredentials.privateKeyFromPkcs8(SA_PRIVATE_KEY_PKCS8);
 ServiceAccountJwtAccessCredentials credentials = ServiceAccountJwtAccessCredentials.newBuilder()
   .setClientId(SA_CLIENT_ID)
   .setClientEmail(SA_CLIENT_EMAIL)
   .setPrivateKey(privateKey)
   .setPrivateKeyId(SA_PRIVATE_KEY_ID)
   .build();
 
 assertEquals(SA_CLIENT_ID, credentials.getClientId());
 assertEquals(SA_CLIENT_EMAIL, credentials.getClientEmail());
 assertEquals(privateKey, credentials.getPrivateKey());
 assertEquals(SA_PRIVATE_KEY_ID, credentials.getPrivateKeyId());
}
com.google.auth.oauth2ServiceAccountJwtAccessCredentialsgetClientId

Popular methods of ServiceAccountJwtAccessCredentials

  • newBuilder
  • getClientEmail
  • getPrivateKey
  • fromPkcs8
    Factory using PKCS#8 for the private key.
  • fromStream
    Returns credentials defined by a Service Account key file in JSON format from the Google Developers
  • getPrivateKeyId
  • <init>
    Constructor with full information.
  • blockingGetToCallback
  • createCache
  • equals
  • fromJson
    Returns service account credentials defined by JSON using the format supported by the Google Develop
  • getAccount
  • fromJson,
  • getAccount,
  • getJwtAccess,
  • getRequestMetadata,
  • hashCode,
  • sign,
  • toString

Popular in Java

  • Reactive rest calls using spring rest template
  • compareTo (BigDecimal)
  • getContentResolver (Context)
  • scheduleAtFixedRate (Timer)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Path (java.nio.file)
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now