Package io.grpc.auth

Class GoogleAuthLibraryCallCredentials.JwtHelper

    • Constructor Summary

      Constructors 
      Constructor Description
      JwtHelper​(java.lang.Class<?> rawServiceAccountClass, java.lang.ClassLoader loader)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.google.auth.Credentials tryServiceAccountToJwt​(com.google.auth.Credentials creds)
      This method tries to convert a Credentials object to a ServiceAccountJwtAccessCredentials.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • serviceAccountClass

        private final java.lang.Class<? extends com.google.auth.Credentials> serviceAccountClass
      • newJwtBuilder

        private final java.lang.reflect.Method newJwtBuilder
      • build

        private final java.lang.reflect.Method build
      • getScopes

        private final java.lang.reflect.Method getScopes
    • Constructor Detail

      • JwtHelper

        public JwtHelper​(java.lang.Class<?> rawServiceAccountClass,
                         java.lang.ClassLoader loader)
                  throws java.lang.ClassNotFoundException,
                         java.lang.NoSuchMethodException
        Throws:
        java.lang.ClassNotFoundException
        java.lang.NoSuchMethodException
    • Method Detail

      • tryServiceAccountToJwt

        public com.google.auth.Credentials tryServiceAccountToJwt​(com.google.auth.Credentials creds)
        This method tries to convert a Credentials object to a ServiceAccountJwtAccessCredentials. The original credentials will be returned if:
        • The Credentials is not a ServiceAccountCredentials
        • The ServiceAccountCredentials has scopes
        • Something unexpected happens
        Parameters:
        creds - the Credentials to convert
        Returns:
        either the original Credentials or a fully formed ServiceAccountJwtAccessCredentials.