public Credential createBigQueryCredential ( Configuration config ) throws GeneralSecurityException , IOException { Credential credential = CredentialFromAccessTokenProviderClassFactory . credential ( new AccessTokenProviderClassFromConfigFactory ( ) . withOverridePrefix ( "mapred.bq" ) , config , BIGQUERY_OAUTH_SCOPES ) ; if ( credential != null ) { return credential ; } return HadoopCredentialConfiguration . newBuilder ( ) . withConfiguration ( config ) . withOverridePrefix ( BIGQUERY_CONFIG_PREFIX ) . build ( ) . getCredential ( BIGQUERY_OAUTH_SCOPES ) ; }
Construct credentials from the passed Configuration .