This commit is contained in:
Egor Cherniak 2022-04-06 11:16:06 +03:00
parent 80c756f2b9
commit 14f2e20417
No known key found for this signature in database
GPG Key ID: 26F47333B7BE4ED9

View File

@ -44,11 +44,21 @@ public class BouncerContextFactory {
var contextReports = buildReportContext(bouncerContext);
return new ContextFragment()
.setAuth(buildAuth())
.setUser(buildUser())
.setEnv(env)
.setAnapi(contextAnalyticsApi)
.setReports(contextReports);
}
private User buildUser() {
var user = new User();
var token = keycloakService.getAccessToken();
return user
.setId(token.getSubject())
.setEmail(token.getEmail())
.setRealm(new Entity().setId(bouncerProperties.getRealm()));
}
private Auth buildAuth() {
var auth = new Auth();
var accessToken = keycloakService.getAccessToken();