Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 35329200B6D for ; Fri, 15 Jul 2016 16:41:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 33EDD160A61; Fri, 15 Jul 2016 14:41:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5B44A160A87 for ; Fri, 15 Jul 2016 16:41:22 +0200 (CEST) Received: (qmail 88824 invoked by uid 500); 15 Jul 2016 14:41:21 -0000 Mailing-List: contact dev-help@shiro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@shiro.apache.org Delivered-To: mailing list dev@shiro.apache.org Received: (qmail 88432 invoked by uid 99); 15 Jul 2016 14:41:21 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jul 2016 14:41:21 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 32E702C0033 for ; Fri, 15 Jul 2016 14:41:21 +0000 (UTC) Date: Fri, 15 Jul 2016 14:41:21 +0000 (UTC) From: "Brian Demers (JIRA)" To: dev@shiro.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Reopened] (SHIRO-350) Creating a subject should not create a session MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 15 Jul 2016 14:41:23 -0000 [ https://issues.apache.org/jira/browse/SHIRO-350?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Brian Demers reopened SHIRO-350: -------------------------------- Assignee: (was: Les Hazlewood) > Creating a subject should not create a session > ---------------------------------------------- > > Key: SHIRO-350 > URL: https://issues.apache.org/jira/browse/SHIRO-350 > Project: Shiro > Issue Type: Bug > Affects Versions: 1.2.0 > Reporter: Dan Finkelstein > Fix For: 1.2.1 > > > When the following method is called: > public Subject getSubjectByLogin(final String login) { > PrincipalCollection principals = new SimplePrincipalCollection(login, REALM_NAME); > return new Subject.Builder().principals(principals).buildSubject(); > } > it throws an exception on buildSubject(): > Caused by: java.lang.IllegalArgumentException: SessionContext must be an HTTP compatible implementation. > at org.apache.shiro.web.session.mgt.ServletContainerSessionManager.createSession(ServletContainerSessionManager.java:103) > at org.apache.shiro.web.session.mgt.ServletContainerSessionManager.start(ServletContainerSessionManager.java:64) > at org.apache.shiro.mgt.SessionsSecurityManager.start(SessionsSecurityManager.java:121) > at org.apache.shiro.subject.support.DelegatingSubject.getSession(DelegatingSubject.java:336) > at org.apache.shiro.subject.support.DelegatingSubject.getSession(DelegatingSubject.java:314) > at org.apache.shiro.mgt.DefaultSubjectDAO.mergePrincipals(DefaultSubjectDAO.java:182) > at org.apache.shiro.mgt.DefaultSubjectDAO.saveToSession(DefaultSubjectDAO.java:163) > at org.apache.shiro.mgt.DefaultSubjectDAO.save(DefaultSubjectDAO.java:144) > at org.apache.shiro.mgt.DefaultSecurityManager.save(DefaultSecurityManager.java:383) > at org.apache.shiro.mgt.DefaultSecurityManager.createSubject(DefaultSecurityManager.java:350) > at org.apache.shiro.subject.Subject$Builder.buildSubject(Subject.java:846) > It tries to create a session but really should not. > Please see forum http://shiro-user.582556.n2.nabble.com/Subject-being-changed-td7370203.html for more details > In our app, in our backoffice area, we display lists of users and their roles, and this functionality is used in this way. -- This message was sent by Atlassian JIRA (v6.3.4#6332)