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

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

Best Java code snippets using com.google.auth.oauth2.ServiceAccountJwtAccessCredentials.fromStream (Showing top 5 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: com.google.auth/google-auth-library-oauth2-http

/**
 * Returns credentials defined by a Service Account key file in JSON format from the Google
 * Developers Console.
 *
 * @param credentialsStream the stream with the credential definition.
 * @return the credential defined by the credentialsStream.
 * @throws IOException if the credential cannot be created from the stream.
 **/
public static ServiceAccountJwtAccessCredentials fromStream(InputStream credentialsStream)
  throws IOException {
 return fromStream(credentialsStream, null);
}
origin: googleapis/google-auth-library-java

/**
 * Returns credentials defined by a Service Account key file in JSON format from the Google
 * Developers Console.
 *
 * @param credentialsStream the stream with the credential definition.
 * @return the credential defined by the credentialsStream.
 * @throws IOException if the credential cannot be created from the stream.
 **/
public static ServiceAccountJwtAccessCredentials fromStream(InputStream credentialsStream)
  throws IOException {
 return fromStream(credentialsStream, null);
}
origin: googleapis/google-auth-library-java

 private static void testFromStreamException(InputStream stream, String expectedMessageContent) {
  try {
   ServiceAccountJwtAccessCredentials.fromStream(stream, CALL_URI);
   fail(String.format("Should throw exception with message containing '%s'",
     expectedMessageContent));
  } catch (IOException expected) {
   assertTrue(expected.getMessage().contains(expectedMessageContent));
  }
 }
}
origin: googleapis/google-auth-library-java

@Test
public void fromStream_defaultURI_hasJwtAccess() throws IOException {
 InputStream serviceAccountStream = ServiceAccountCredentialsTest
   .writeServiceAccountStream(
     SA_CLIENT_ID, SA_CLIENT_EMAIL, SA_PRIVATE_KEY_PKCS8, SA_PRIVATE_KEY_ID);
 Credentials credentials =
   ServiceAccountJwtAccessCredentials.fromStream(serviceAccountStream, CALL_URI);
 assertNotNull(credentials);
 Map<String, List<String>> metadata = credentials.getRequestMetadata(null);
 verifyJwtAccess(metadata, SA_CLIENT_EMAIL, CALL_URI, SA_PRIVATE_KEY_ID);
}
origin: googleapis/google-auth-library-java

@Test
public void fromStream_hasJwtAccess() throws IOException {
 InputStream serviceAccountStream = ServiceAccountCredentialsTest
   .writeServiceAccountStream(
     SA_CLIENT_ID, SA_CLIENT_EMAIL, SA_PRIVATE_KEY_PKCS8, SA_PRIVATE_KEY_ID);
 Credentials credentials =
   ServiceAccountJwtAccessCredentials.fromStream(serviceAccountStream);
 assertNotNull(credentials);
 Map<String, List<String>> metadata = credentials.getRequestMetadata(CALL_URI);
 verifyJwtAccess(metadata, SA_CLIENT_EMAIL, CALL_URI, SA_PRIVATE_KEY_ID);
}
com.google.auth.oauth2ServiceAccountJwtAccessCredentialsfromStream

Javadoc

Returns credentials defined by a Service Account key file in JSON format from the Google Developers Console.

Popular methods of ServiceAccountJwtAccessCredentials

  • newBuilder
  • getClientEmail
  • getPrivateKey
  • fromPkcs8
    Factory using PKCS#8 for the private key.
  • 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
  • getAccount
  • fromJson,
  • getAccount,
  • getJwtAccess,
  • getRequestMetadata,
  • hashCode,
  • sign,
  • toString

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