/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package io.buji.oauth;

import org.apache.shiro.SecurityUtils;
import org.scribe.up.session.UserSession;

/**
 * This implementation uses the Shiro session for the user session.
 * 
 * @author Jerome Leleu
 * @since 1.0.0
 */
public final class ShiroUserSession implements UserSession {
    
    public void setAttribute(String key, Object value) {
        SecurityUtils.getSubject().getSession().setAttribute(key, value);
    }
    
    public Object getAttribute(String key) {
        return SecurityUtils.getSubject().getSession().getAttribute(key);
    }
}

@@ -881,37 +881,155 @@
 org.
-scribe.up.session.UserSession
+apache.shiro.UnavailableSecurityManagerException;%0Aimport org.scribe.up.session.UserSession;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory
 ;%0A%0A/
@@ -1209,24 +1209,105 @@
 sion %7B%0A    %0A
+    private static Logger log = LoggerFactory.getLogger(OAuthFilter.class);%0A    %0A
     public v
@@ -1347,24 +1347,83 @@
 ct value) %7B%0A
+        // TODO : find a better solution%0A        try %7B%0A    
         Secu
@@ -1484,16 +1484,199 @@
 value);%0A
+        %7D catch (UnavailableSecurityManagerException e) %7B%0A            log.warn(%22Should happen just once at startup in some specific case of Shiro Spring configuration%22, e);%0A        %7D%0A
     %7D%0A  

add try catch on setAttribute for some specific case of Shiro Spring configuration