public static void putCredential(final RequestContext context, final Credential credential) {
        if (credential == null) {
            context.getRequestScope().remove(PARAMETER_CREDENTIAL);
            context.getFlowScope().remove(PARAMETER_CREDENTIAL);
            context.getConversationScope().remove(PARAMETER_CREDENTIAL);
        } else {
            putCredentialIntoScope(context.getRequestScope(), credential);
            putCredentialIntoScope(context.getFlowScope(), credential);
            putCredentialIntoScope(context.getConversationScope(), credential);
        }
    }
Puts credential into the context.

@param context    the context
@param credential the credential
core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java