They are both correct, even if in your second example you do not contract I have.
YourDict has examples with both:
- When it was entirely consumed, the boundary stone, which had been previously anointed and crowned with garlands, was placed upon the hot ashes and fixed in the ground.
- He had previously been recalled by the optimates, but ignored the order.
However, most dictionaries only offer examples similar to your first sentence, as it is more formal, more standard.
You are definitely safe in using either. As this Ngram shows, both usages are quite common:
