Codota Logo
ServiceAccountJwtAccessCredentials.toString
Code IndexAdd Codota to your IDE (free)

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: googleapis/google-auth-library-java

@Test
public void toString_containsFields() 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)
   .setDefaultAudience(CALL_URI)
   .build();
 String expectedToString = String.format(
   "ServiceAccountJwtAccessCredentials{clientId=%s, clientEmail=%s, privateKeyId=%s, "
     + "defaultAudience=%s}",
   SA_CLIENT_ID,
   SA_CLIENT_EMAIL,
   SA_PRIVATE_KEY_ID,
   CALL_URI);
 assertEquals(expectedToString, credentials.toString());
}
origin: googleapis/google-auth-library-java

@Test
public void serialize() throws IOException, ClassNotFoundException {
 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)
   .setDefaultAudience(CALL_URI)
   .build();
 ServiceAccountJwtAccessCredentials deserializedCredentials =
   serializeAndDeserialize(credentials);
 verifyJwtAccess(deserializedCredentials.getRequestMetadata(), SA_CLIENT_EMAIL, CALL_URI, SA_PRIVATE_KEY_ID);
 assertEquals(credentials, deserializedCredentials);
 assertEquals(credentials.hashCode(), deserializedCredentials.hashCode());
 assertEquals(credentials.toString(), deserializedCredentials.toString());
 assertSame(deserializedCredentials.clock, Clock.SYSTEM);
}
com.google.auth.oauth2ServiceAccountJwtAccessCredentialstoString

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
  • getClientId
  • 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
  • equals,
  • fromJson,
  • getAccount,
  • getJwtAccess,
  • getRequestMetadata,
  • hashCode,
  • sign

Popular in Java

  • Updating database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • addToBackStack (FragmentTransaction)
  • getSharedPreferences (Context)
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • LinkedHashMap (java.util)
    Hash table and linked list implementation of the Map interface, with predictable iteration order. Th
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now