Subject.runAs

Allows this subject to 'run as' or 'assume' another identity indefinitely. This can only be called when the {@code Subject} instance already has an identity (i.e. they are remembered from a previous log-in or they have authenticated during their current session). <p/> Some notes about {@code runAs}: <ul> <li>You can tell if a {@code Subject} is 'running as' another identity by calling the {@link #isRunAs() isRunAs()} method.</li> <li>If running as another identity, you can determine what the previous 'pre run as' identity was by calling the {@link #getPreviousPrincipals() getPreviousPrincipals()} method.</li> <li>When you want a {@code Subject} to stop running as another identity, you can return to its previous 'pre run as' identity by calling the {@link #releaseRunAs() releaseRunAs()} method.</li> </ul>

@param principals the identity to 'run as', aka the identity to <em>assume</em> indefinitely. @throws NullPointerException if the specified principals collection is {@code null} or empty. @throws IllegalStateException if this {@code Subject} does not yet have an identity of its own.

interface Subject
void
runAs

Meta