mirror of
https://github.com/valitydev/anapi-v2.git
synced 2024-11-06 00:25:17 +00:00
Add user
This commit is contained in:
parent
80c756f2b9
commit
14f2e20417
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user