/** * Provide the request metadata by putting an access JWT directly in the metadata. */ @Override public Map<String, List<String>> getRequestMetadata(URI uri) throws IOException { if (uri == null) { if (defaultAudience != null) { uri = defaultAudience; } else { throw new IOException("JwtAccess requires Audience uri to be passed in or the " + "defaultAudience to be specified"); } } String assertion = getJwtAccess(uri); String authorizationHeader = JWT_ACCESS_PREFIX + assertion; List<String> newAuthorizationHeaders = Collections.singletonList(authorizationHeader); return Collections.singletonMap(AuthHttpConstants.AUTHORIZATION, newAuthorizationHeaders); }
/** * Provide the request metadata by putting an access JWT directly in the metadata. */ @Override public Map<String, List<String>> getRequestMetadata(URI uri) throws IOException { if (uri == null) { if (defaultAudience != null) { uri = defaultAudience; } else { throw new IOException("JwtAccess requires Audience uri to be passed in or the " + "defaultAudience to be specified"); } } String assertion = getJwtAccess(uri); String authorizationHeader = JWT_ACCESS_PREFIX + assertion; List<String> newAuthorizationHeaders = Collections.singletonList(authorizationHeader); return Collections.singletonMap(AuthHttpConstants.AUTHORIZATION, newAuthorizationHeaders); }