for (Group g : session.getRelationshipManager().findAssociatedGroups(user)) {
identity.get().addGroup(g.getName(), g.getGroupType());
}
} catch (FeatureNotSupportedException ex) {
throw new AuthenticationException("Error loading user's roles and groups", ex);
} catch (IdentityException ex) {
throw new AuthenticationException("Error loading user's roles and groups", ex);
}
}
} catch (IdentityException ex) {
throw new AuthenticationException("Error locating User record for OAuth user", ex);
}
}