Example usage for org.springframework.session.data.mongo AuthenticationParser extractName

List of usage examples for org.springframework.session.data.mongo AuthenticationParser extractName

Introduction

In this page you can find the example usage for org.springframework.session.data.mongo AuthenticationParser extractName.

Prototype

@Nullable
static String extractName(@Nullable Object authentication) 

Source Link

Document

Extracts principal name from authentication.

Usage

From source file:org.springframework.session.data.mongo.AbstractMongoSessionConverter.java

protected String extractPrincipal(Session expiringSession) {
    String resolvedPrincipal = AuthenticationParser
            .extractName(expiringSession.getAttribute(SPRING_SECURITY_CONTEXT));
    if (resolvedPrincipal != null) {
        return resolvedPrincipal;
    } else {// w  w  w.j  a  v a2s.c o  m
        return expiringSession.getAttribute(FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME);
    }
}