Search in sources :

Example 1 with IdpSessionPrincipal

use of com.haulmont.cuba.web.security.idp.IdpSessionPrincipal in project cuba by cuba-platform.

the class IdpAuthProvider method userSessionLoggedIn.

@Override
public void userSessionLoggedIn(UserSession session) {
    VaadinRequest currentRequest = VaadinService.getCurrentRequest();
    if (currentRequest != null) {
        Principal principal = currentRequest.getUserPrincipal();
        if (principal instanceof IdpSessionPrincipal) {
            IdpSession idpSession = ((IdpSessionPrincipal) principal).getIdpSession();
            session.setAttribute(IdpService.IDP_USER_SESSION_ATTRIBUTE, idpSession.getId());
        }
    }
}
Also used : IdpSession(com.haulmont.cuba.security.global.IdpSession) VaadinRequest(com.vaadin.server.VaadinRequest) IdpSessionPrincipal(com.haulmont.cuba.web.security.idp.IdpSessionPrincipal) Principal(java.security.Principal) IdpSessionPrincipal(com.haulmont.cuba.web.security.idp.IdpSessionPrincipal)

Aggregations

IdpSession (com.haulmont.cuba.security.global.IdpSession)1 IdpSessionPrincipal (com.haulmont.cuba.web.security.idp.IdpSessionPrincipal)1 VaadinRequest (com.vaadin.server.VaadinRequest)1 Principal (java.security.Principal)1