Example usage for org.apache.shiro.session.mgt SessionContext setSessionId

List of usage examples for org.apache.shiro.session.mgt SessionContext setSessionId

Introduction

In this page you can find the example usage for org.apache.shiro.session.mgt SessionContext setSessionId.

Prototype

void setSessionId(Serializable sessionId);

Source Link

Usage

From source file:org.ow2.proactive.workflowcatalog.SchedulerAuthentication.java

License:Open Source License

private static Subject createSubject(String token, ISchedulerProxy scheduler) {
    SessionContext sessionContext = new DefaultSessionContext();
    sessionContext.setSessionId(token);
    sessionContext.put(HttpHeaderTokenSessionManager.TOKEN_KEY, token);
    sessionContext.put(SchedulerRestSession.SCHEDULER_SESSION_KEY, scheduler);
    Session session = SecurityUtils.getSecurityManager().start(sessionContext);

    return new Subject.Builder().session(session).buildSubject();
}