当前位置: 首页>>代码示例>>Java>>正文


Java SubjectContext.setSessionCreationEnabled方法代码示例

本文整理汇总了Java中org.apache.shiro.subject.SubjectContext.setSessionCreationEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java SubjectContext.setSessionCreationEnabled方法的具体用法?Java SubjectContext.setSessionCreationEnabled怎么用?Java SubjectContext.setSessionCreationEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.shiro.subject.SubjectContext的用法示例。


在下文中一共展示了SubjectContext.setSessionCreationEnabled方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createSubject

import org.apache.shiro.subject.SubjectContext; //导入方法依赖的package包/类
@Override
public Subject createSubject(SubjectContext context) {
    context.setSessionCreationEnabled(false);
    return super.createSubject(context);
}
 
开发者ID:booleguo,项目名称:sam-elle,代码行数:6,代码来源:StatelessDefaultSubjectFactory.java

示例2: createSubject

import org.apache.shiro.subject.SubjectContext; //导入方法依赖的package包/类
@Override
public Subject createSubject(SubjectContext context) {
    //不创建session
    context.setSessionCreationEnabled(false);
    super.createSubject(context).getSession(false);
    return super.createSubject(context);
}
 
开发者ID:YupaiTS,项目名称:docs-manage,代码行数:8,代码来源:StatelessSubjectFactory.java

示例3: createSubject

import org.apache.shiro.subject.SubjectContext; //导入方法依赖的package包/类
@Override
public Subject createSubject(SubjectContext context) {
    // 不创建session
    context.setSessionCreationEnabled(false);

    return super.createSubject(context);
}
 
开发者ID:wanghongfei,项目名称:shiro-spring-boot-starter,代码行数:8,代码来源:StatelessSubjectFactory.java

示例4: createSubject

import org.apache.shiro.subject.SubjectContext; //导入方法依赖的package包/类
public Subject createSubject(SubjectContext context) {
    //不创建session, 如果之后调用Subject.getSession()将抛出DisabledSessionException异常。
    context.setSessionCreationEnabled(false);
    return super.createSubject(context);
}
 
开发者ID:auslides,项目名称:stateless-shiro,代码行数:6,代码来源:StalessSubjectFactory.java

示例5: createSubject

import org.apache.shiro.subject.SubjectContext; //导入方法依赖的package包/类
@Override
public Subject createSubject(SubjectContext context) {
    // 不创建session
    context.setSessionCreationEnabled(false);
    return super.createSubject(context);
}
 
开发者ID:howiefh,项目名称:jee-restful-web,代码行数:7,代码来源:StatelessDefaultSubjectFactory.java

示例6: login

import org.apache.shiro.subject.SubjectContext; //导入方法依赖的package包/类
/**
 * Logs in the specified Subject using the given {@code authenticationToken}, returning an updated Subject
 * instance reflecting the authenticated state if successful or throwing {@code AuthenticationException} if it is
 * not.
 * <p>
 * Note that most application developers should probably not call this method directly unless they have a good
 * reason for doing so.  The preferred way to log in a Subject is to call
 * <code>subject.{@link Subject#login login(authenticationToken)}</code> (usually after
 * acquiring the Subject by calling {@link SecurityUtils#getSubject() SecurityUtils.getSubject()}).
 * <p>
 * Framework developers on the other hand might find calling this method directly useful in certain cases.
 *
 * @param subject             the subject against which the authentication attempt will occur
 * @param authenticationToken the token representing the Subject's principal(s) and credential(s)
 * @return the subject instance reflecting the authenticated state after a successful attempt
 * @throws AuthenticationException if the login attempt failed.
 * @since 1.0
 */
@Override
public Subject login(Subject subject, AuthenticationToken authenticationToken) throws AuthenticationException {

    AuthenticationInfo info = authenticate(authenticationToken);

    SubjectContext context = new DefaultSubjectContext();
    context.setAuthenticated(true);
    context.setAuthenticationToken(authenticationToken);
    context.setAuthenticationInfo(info);
    context.setSessionCreationEnabled(true);
    if (subject != null) {
        context.setSubject(subject);
    }

    return createSubject(context);
}
 
开发者ID:caricah,项目名称:iotracah,代码行数:35,代码来源:IOTSecurityManager.java


注:本文中的org.apache.shiro.subject.SubjectContext.setSessionCreationEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。