public static CallCredentials bearerAuth ( final String token ) { final Metadata extraHeaders = new Metadata ( ) ; extraHeaders . put ( AUTHORIZATION_HEADER , BEARER_AUTH_PREFIX + token ) ; return new StaticSecurityHeaderCallCredentials ( extraHeaders ) ; }
Creates a new call credential with the given token for bearer auth .