It is explained in this MO discussion that if one has a morphism $f:X\rightarrow Y$ of schemes such that $X$ is an affine scheme, then $f$ need not be an affine morphism. However, if $Y$ is separated, then $f$ is indeed affine.
Question: what happens is if $Y$ is an Artin stack? (But $X$ is still an affine scheme). What are some natural conditions on $Y$ to ensure that $f$ is an affine map?
The example I have in mind is when $Y$ is the stack of rank $n$ vector bundles.