org.springframework.security.oauth.consumer.OAuthSecurityContextHolder.java Source code

Java tutorial

Introduction

Here is the source code for org.springframework.security.oauth.consumer.OAuthSecurityContextHolder.java

Source

package org.springframework.security.oauth.consumer;

/**
 * Holder for the current OAuth security context.
 *
 * @author Ryan Heaton
 */
public class OAuthSecurityContextHolder {

    private static final ThreadLocal<OAuthSecurityContext> CURRENT_CONTEXT = new ThreadLocal<OAuthSecurityContext>();

    public static OAuthSecurityContext getContext() {
        return CURRENT_CONTEXT.get();
    }

    public static void setContext(OAuthSecurityContext context) {
        CURRENT_CONTEXT.set(context);
    }
}